Package org.restlet.client.data
Class Encoding
- java.lang.Object
-
- org.restlet.client.data.Metadata
-
- org.restlet.client.data.Encoding
-
public final class Encoding extends Metadata
Modifier of a representation's media type. Useful to apply compression without losing the identity of the underlying media type.- Author:
- Jerome Louvel
-
-
Field Summary
Fields Modifier and Type Field Description static EncodingALLAll encodings acceptable.static EncodingCOMPRESSThe common Unix file compression.static EncodingDEFLATEThe zlib format defined by RFC 1950 and 1951.static EncodingDEFLATE_NOWRAPThe zlib format defined by RFC 1950 and 1951, without wrapping.static EncodingFREEMARKERThe FreeMarker encoding.static EncodingGZIPThe GNU Zip encoding.static EncodingIDENTITYThe default (identity) encoding.static EncodingVELOCITYThe Velocity encoding.static EncodingZIPThe Info-Zip encoding.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object object)MetadatagetParent()Returns the parent metadata if available or null.inthashCode()booleanincludes(Metadata included)Indicates if a given encoding is included in the current one.static EncodingvalueOf(java.lang.String name)Returns the encoding associated to a name.-
Methods inherited from class org.restlet.client.data.Metadata
getDescription, getName, isCompatible, toString
-
-
-
-
Field Detail
-
ALL
public static final Encoding ALL
All encodings acceptable.
-
COMPRESS
public static final Encoding COMPRESS
The common Unix file compression.
-
DEFLATE
public static final Encoding DEFLATE
The zlib format defined by RFC 1950 and 1951.
-
DEFLATE_NOWRAP
public static final Encoding DEFLATE_NOWRAP
The zlib format defined by RFC 1950 and 1951, without wrapping.
-
FREEMARKER
public static final Encoding FREEMARKER
The FreeMarker encoding.
-
GZIP
public static final Encoding GZIP
The GNU Zip encoding.
-
IDENTITY
public static final Encoding IDENTITY
The default (identity) encoding.
-
VELOCITY
public static final Encoding VELOCITY
The Velocity encoding.
-
ZIP
public static final Encoding ZIP
The Info-Zip encoding.
-
-
Method Detail
-
valueOf
public static Encoding valueOf(java.lang.String name)
Returns the encoding associated to a name. If an existing constant exists then it is returned, otherwise a new instance is created.- Parameters:
name- The name.- Returns:
- The associated encoding.
-
getParent
public Metadata getParent()
Description copied from class:MetadataReturns the parent metadata if available or null.
-
includes
public boolean includes(Metadata included)
Indicates if a given encoding is included in the current one. The test is true if both encodings are equal or if the given encoding is within the range of the current one. For example, ALL includes all encodings. A null encoding is considered as included into the current one.Examples:
- ALL.includes(COMPRESS) returns true
- COMPRESS.includes(ALL) returns false
- Specified by:
includesin classMetadata- Parameters:
included- The encoding to test for inclusion.- Returns:
- True if the given encoding is included in the current one.
- See Also:
Metadata.isCompatible(Metadata)
-
-