| Modifier and Type | Class and Description |
|---|---|
| public abstract static class | Variant.VariantListBuilder
A builder for a list of representation variants. |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private Locale | |
| private MediaType |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Variant(MediaType
the media type of the variant - may be mediaType, String null.the language of the variant (two-letter ISO-639 code);
may be language, String null.uppercase two-letter ISO-3166 language code of the variant;
may be country, String null provided language is null too.the content encoding of the variant - may be encoding)null.Create a new instance of Variant. |
| public | Variant(MediaType
the media type of the variant - may be mediaType, String null.the language of the variant (two-letter ISO-639 code);
may be language, String null.uppercase two-letter ISO-3166 language code of the variant;
may be country, String null provided language is null too.vendor and browser specific language code of the variant
(see also languageVariant, String Locale class description);
may be null provided language and
country are null too.the content encoding of the variant - may be encoding)null.Create a new instance of Variant. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Variant. | Returns: the initialized builder.the available encodings. encodings)Create a |
| public boolean | Returns: true if the two variants are the same, false otherwise.the object to compare to. obj)Overrides java. |
| public String | |
| public Locale | |
| public String | Returns: the string representing variant language ornull
if none set.Get the string representation of the variant language,
or |
| public MediaType | |
| public int | Returns: the hash code.Overrides java. |
| public static Variant. | Returns: the initialized builder.the available languages. languages)Create a |
| public static Variant. | Returns: the initialized builder.the available mediaTypes. If specific char-sets
are supported they should be included as parameters of the respective
media type. mediaTypes)Create a |
| public String |
| encoding | back to summary |
|---|---|
| private String encoding | |
| language | back to summary |
|---|---|
| private Locale language | |
| mediaType | back to summary |
|---|---|
| private MediaType mediaType | |
| Variant | back to summary |
|---|---|
| public Variant(MediaType mediaType, String language, String encoding) Create a new instance of Variant.
| |
| Variant | back to summary |
|---|---|
| public Variant(MediaType mediaType, String language, String country, String encoding) Create a new instance of Variant.
| |
| Variant | back to summary |
|---|---|
| public Variant(MediaType mediaType, String language, String country, String languageVariant, String encoding) Create a new instance of Variant.
| |
| Variant | back to summary |
|---|---|
| public Variant(MediaType mediaType, Locale language, String encoding) Create a new instance of Variant.
| |
| encodings | back to summary |
|---|---|
| public static Variant. Create a
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Compares obj to this variant to see if they are the same considering all property values. | |
| getEncoding | back to summary |
|---|---|
| public String getEncoding() Get the encoding of the variant.
| |
| getLanguage | back to summary |
|---|---|
| public Locale getLanguage() Get the language of the variant.
| |
| getLanguageString | back to summary |
|---|---|
| public String getLanguageString() Get the string representation of the variant language,
or
| |
| getMediaType | back to summary |
|---|---|
| public MediaType getMediaType() Get the media type of the variant.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Generate hash code from variant properties.
| |
| languages | back to summary |
|---|---|
| public static Variant. Create a
| |
| mediaTypes | back to summary |
|---|---|
| public static Variant. Create a
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Variant. | Returns: the updated builder.Add the current combination of metadata to the list of supported variants, after this method is called the current combination of metadata is emptied. |
| public abstract List | Returns: a list of representation variants.Add the current combination of metadata to the list of supported variants (provided the current combination of metadata is not empty) and build a list of representation variants from the current state of the builder. |
| public abstract Variant. | |
| public abstract Variant. | |
| public abstract Variant. | Returns: the updated builder.the available mediaTypes. If specific charsets
are supported they should be included as parameters of the respective
media type. mediaTypes)Set the media type(s) for this variant. |
| public static Variant. |
| VariantListBuilder | back to summary |
|---|---|
| protected VariantListBuilder() Protected constructor, use the static | |
| add | back to summary |
|---|---|
| public abstract Variant. Add the current combination of metadata to the list of supported variants, after this method is called the current combination of metadata is emptied.
If more than one value is supplied for one or more of the variant properties
then a variant will be generated for each possible combination. E.g.
in the following List
Note that it is not necessary to call the List
| |
| build | back to summary |
|---|---|
| public abstract List Add the current combination of metadata to the list of supported variants (provided the current combination of metadata is not empty) and build a list of representation variants from the current state of the builder. After this method is called the builder is reset to an empty state. | |
| encodings | back to summary |
|---|---|
| public abstract Variant. Set the encoding(s) for this variant.
| |
| languages | back to summary |
|---|---|
| public abstract Variant. Set the language(s) for this variant.
| |
| mediaTypes | back to summary |
|---|---|
| public abstract Variant. Set the media type(s) for this variant.
| |
| newInstance | back to summary |
|---|---|
| public static Variant. Create a new builder instance.
| |