Modifier | Constructor | Description |
---|---|---|
protected |
VariantListBuilder() |
Protected constructor, use the static
newInstance
method to obtain an instance. |
Modifier and Type | Method | Description |
---|---|---|
abstract Variant.VariantListBuilder |
add() |
Add the current combination of metadata to the list of supported variants,
after this method is called the current combination of metadata is emptied.
|
abstract List<Variant> |
build() |
Build a list of representation variants from the current state of
the builder.
|
abstract Variant.VariantListBuilder |
encodings(String... encodings) |
Set the encoding[s] for this variant.
|
abstract Variant.VariantListBuilder |
languages(Locale... languages) |
Set the language[s] for this variant.
|
abstract Variant.VariantListBuilder |
mediaTypes(MediaType... mediaTypes) |
Set the media type[s] for this variant.
|
static Variant.VariantListBuilder |
newInstance() |
Create a new builder instance.
|
protected VariantListBuilder()
newInstance
method to obtain an instance.public static Variant.VariantListBuilder newInstance()
public abstract List<Variant> build()
public abstract Variant.VariantListBuilder add()
list
would have four members:
Listlist = VariantListBuilder.newInstance().languages("en","fr") .encodings("zip", "identity").add().build()
IllegalStateException
- if there is not at least one
mediaType, language or encoding set for the current variant.public abstract Variant.VariantListBuilder languages(Locale... languages)
languages
- the available languagespublic abstract Variant.VariantListBuilder encodings(String... encodings)
encodings
- the available encodingspublic abstract Variant.VariantListBuilder mediaTypes(MediaType... mediaTypes)
mediaTypes
- the available mediaTypes. If specific charsets
are supported they should be included as parameters of the respective
media type.Copyright © 2019 Sun Microsystems, Inc. All rights reserved.