public class Variant
extends java.lang.Object
Representation
subclasses.Constructor and Description |
---|
Variant()
Default constructor.
|
Variant(MediaType mediaType)
Constructor.
|
Variant(MediaType mediaType,
Language language)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ClientInfo |
createClientInfo()
Creates a
ClientInfo instance with preferences matching exactly
the current variant. |
boolean |
equals(java.lang.Object other)
Indicates if the current variant is equal to the given variant.
|
CharacterSet |
getCharacterSet()
Returns the character set or null if not applicable.
|
java.util.List<Encoding> |
getEncodings()
Returns the modifiable list of encodings applied to the entity-body.
|
java.util.List<Language> |
getLanguages()
Returns the modifiable list of languages.
|
Reference |
getLocationRef()
Returns an optional location reference.
|
MediaType |
getMediaType()
Returns the media type.
|
int |
hashCode() |
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.
|
void |
setEncodings(java.util.List<Encoding> encodings)
Sets the list of encodings applied to the entity-body.
|
void |
setLanguages(java.util.List<Language> languages)
Sets the list of languages.
|
void |
setLocationRef(Reference location)
Sets the optional identifier.
|
void |
setLocationRef(java.lang.String locationUri)
Sets the identifier from a URI string.
|
void |
setMediaType(MediaType mediaType)
Sets the media type.
|
java.lang.String |
toString() |
public Variant()
public Variant(MediaType mediaType)
mediaType
- The media type.public ClientInfo createClientInfo()
ClientInfo
instance with preferences matching exactly
the current variant.ClientInfo
instance.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The other variant.public CharacterSet getCharacterSet()
public java.util.List<Encoding> getEncodings()
public java.util.List<Language> getLanguages()
public Reference getLocationRef()
public MediaType getMediaType()
public int hashCode()
hashCode
in class java.lang.Object
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(java.util.List<Encoding> encodings)
encodings
- The list of encodings applied to the entity-body.public void setLanguages(java.util.List<Language> languages)
languages
- The list of languages.public void setLocationRef(Reference location)
location
- The location reference.public void setLocationRef(java.lang.String locationUri)
locationUri
- The location URI to parse.public void setMediaType(MediaType mediaType)
mediaType
- The media type.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005-2024 Restlet.