|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.ws.rs.core.Variant
public class Variant
Abstraction for a resource representation variant.
Nested Class Summary | |
---|---|
static class |
Variant.VariantListBuilder
A builder for a list of representation variants. |
Constructor Summary | |
---|---|
Variant(MediaType mediaType,
Locale language,
String encoding)
Create a new instance of Variant |
Method Summary | |
---|---|
static Variant.VariantListBuilder |
encodings(String... encodings)
Create a Variant.VariantListBuilder initialized with a set of supported
encodings. |
boolean |
equals(Object obj)
Compares obj to this variant to see if they are the same considering all property values. |
String |
getEncoding()
Get the encoding of the variant |
Locale |
getLanguage()
Get the language of the variant |
MediaType |
getMediaType()
Get the media type of the variant |
int |
hashCode()
Generate hash code from variant properties. |
static Variant.VariantListBuilder |
languages(Locale... languages)
Create a Variant.VariantListBuilder initialized with a set of supported
languages. |
static Variant.VariantListBuilder |
mediaTypes(MediaType... mediaTypes)
Create a Variant.VariantListBuilder initialized with a set of supported
media types. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Variant(MediaType mediaType, Locale language, String encoding)
mediaType
- the media type of the variant - may be nulllanguage
- the language of the variant - may be nullencoding
- the content encoding of the variant - may be null
IllegalArgumentException
- if all three parameters are
nullMethod Detail |
---|
public Locale getLanguage()
public MediaType getMediaType()
public String getEncoding()
public static Variant.VariantListBuilder mediaTypes(MediaType... mediaTypes)
Variant.VariantListBuilder
initialized with a set of supported
media types.
mediaTypes
- the available mediaTypes. If specific charsets
are supported they should be included as parameters of the respective
media type.
IllegalArgumentException
- if mediaTypes is null or
contains no elements.public static Variant.VariantListBuilder languages(Locale... languages)
Variant.VariantListBuilder
initialized with a set of supported
languages.
languages
- the available languages.
IllegalArgumentException
- if languages is null or
contains no elements.public static Variant.VariantListBuilder encodings(String... encodings)
Variant.VariantListBuilder
initialized with a set of supported
encodings.
encodings
- the available encodings.
IllegalArgumentException
- if encodings is null or
contains no elements.public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- the object to compare to
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |