Package org.restlet.data
Class Encoding
java.lang.Object
org.restlet.data.Metadata
org.restlet.data.Encoding
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
FieldsModifier and TypeFieldDescriptionstatic final EncodingAll encodings acceptable.static final EncodingThe common Unix file compression.static final EncodingThe zlib format defined by RFC 1950 and 1951.static final EncodingThe zlib format defined by RFC 1950 and 1951, without wrapping.static final EncodingThe FreeMarker encoding.static final EncodingThe GNU Zip encoding.static final EncodingThe default (identity) encoding.static final EncodingThe Velocity encoding.static final EncodingThe Info-Zip encoding. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.restlet.data.Metadata
getDescription, getName, isCompatible, toString
-
Field Details
-
ALL
All encodings acceptable. -
COMPRESS
The common Unix file compression. -
DEFLATE
The zlib format defined by RFC 1950 and 1951. -
DEFLATE_NOWRAP
The zlib format defined by RFC 1950 and 1951, without wrapping. -
FREEMARKER
The FreeMarker encoding. -
GZIP
The GNU Zip encoding. -
IDENTITY
The default (identity) encoding. -
VELOCITY
The Velocity encoding. -
ZIP
The Info-Zip encoding.
-
-
Constructor Details
-
Encoding
Constructor.- Parameters:
name- The name.
-
Encoding
Constructor.- Parameters:
name- The name.description- The description.
-
-
Method Details
-
valueOf
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.
-
equals
-
getParent
Description copied from class:MetadataReturns the parent metadata if available or null. -
hashCode
public int hashCode() -
includes
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
-