|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.representation.Variant
public class Variant
Descriptor for available representations of a resource. It contains all the
important metadata about a representation but is not able to actually serve
the representation's content itself.
For this, you need to use on of the Representation
subclasses.
Constructor Summary | |
---|---|
Variant()
Default constructor. |
|
Variant(MediaType mediaType)
Constructor. |
|
Variant(MediaType mediaType,
Language language)
Constructor. |
Method Summary | |
---|---|
ClientInfo |
createClientInfo()
Creates a ClientInfo instance with preferences matching exactly
the current variant. |
boolean |
equals(Object other)
Indicates if the current variant is equal to the given variant. |
CharacterSet |
getCharacterSet()
Returns the character set or null if not applicable. |
List<Encoding> |
getEncodings()
Returns the modifiable list of encodings applied to the entity-body. |
List<Language> |
getLanguages()
Returns the modifiable list of languages. |
Reference |
getLocationRef()
Returns an optional location reference. |
MediaType |
getMediaType()
Returns the media type. Note that when used with HTTP connectors, this property maps to the "Content-Type" header. |
boolean |
includes(Variant other)
Indicates if the current variant includes the given variant. |
boolean |
isCompatible(Variant other)
Indicates if the current variant is compatible with the given variant. |
void |
setCharacterSet(CharacterSet characterSet)
Sets the character set or null if not applicable. Note that when used with HTTP connectors, this property maps to the "Content-Type" header. |
void |
setEncodings(List<Encoding> encodings)
Sets the list of encodings applied to the entity-body. Note that when used with HTTP connectors, this property maps to the "Content-Encoding" header. |
void |
setLanguages(List<Language> languages)
Sets the list of languages. Note that when used with HTTP connectors, this property maps to the "Content-Language" header. |
void |
setLocationRef(Reference location)
Sets the optional identifier. |
void |
setLocationRef(String locationUri)
Sets the identifier from a URI string. Note that when used with HTTP connectors, this property maps to the "Content-Location" header. |
void |
setMediaType(MediaType mediaType)
Sets the media type. Note that when used with HTTP connectors, this property maps to the "Content-Type" header. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Variant()
public Variant(MediaType mediaType)
mediaType
- The media type.public Variant(MediaType mediaType, Language language)
mediaType
- The media type.language
- The language.Method Detail |
---|
public ClientInfo createClientInfo()
ClientInfo
instance with preferences matching exactly
the current variant.
ClientInfo
instance.public boolean equals(Object other)
equals
in class Object
other
- The other variant.
public CharacterSet getCharacterSet()
public List<Encoding> getEncodings()
public List<Language> getLanguages()
public Reference getLocationRef()
public MediaType getMediaType()
public boolean includes(Variant other)
other
- The other variant.
public boolean isCompatible(Variant other)
other
- The other variant.
public void setCharacterSet(CharacterSet characterSet)
characterSet
- The character set or null if not applicable.public void setEncodings(List<Encoding> encodings)
encodings
- The list of encodings applied to the entity-body.public void setLanguages(List<Language> languages)
languages
- The list of languages.public void setLocationRef(Reference location)
location
- The location reference.public void setLocationRef(String locationUri)
locationUri
- The location URI to parse.public void setMediaType(MediaType mediaType)
mediaType
- The media type.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |