public class FieldValueProviderBuilder extends Object
Used to construct a new FieldValueProvider
.
Usage example:
FieldValueProvider fieldValueProvider = FieldValueProviderBuilder.newFieldValueProvider()
.addValue("Foo", "foo")
.addValue("Bar", "bar")
.restrictive()
.build();
Modifier and Type | Method and Description |
---|---|
FieldValueProviderBuilder |
addContext(String key,
String value)
Adds a context entry to the
FieldValueProvider , to be used when calculating
the field's values at display time. |
FieldValueProviderBuilder |
addNamedValue(String name,
String value)
Adds a single value to the
FieldValueProvider using the specified
name as its name. |
FieldValueProviderBuilder |
addNamedValues(Map<String,String> namedValues)
Adds all the given named values to the
FieldValueProvider . |
FieldValueProviderBuilder |
addValue(String value)
Adds a single value to the
FieldValueProvider using the value
itself as the name. |
FieldValueProviderBuilder |
addValues(Collection<String> values)
Adds all the given values to the
FieldValueProvider using the
values themselves as the names. |
FieldValueProvider |
build()
Builds a new
FieldValueProvider using the values provided by
this FieldValueProvider . |
FieldValueProviderBuilder |
dynamic()
Marks this
FieldValueProvider as dynamic, meaning that the
field's values are expected to be calculated at display time. |
FieldValueProviderBuilder |
dynamic(boolean dynamic)
Sets this
FieldValueProvider 's dynamic flag. |
static FieldValueProviderBuilder |
newFieldValueProvider()
Starts building a new
FieldValueProvider . |
FieldValueProviderBuilder |
restrictive()
Marks this
FieldValueProvider as restrictive, meaning that the
corresponding field should be restricted to the provided values. |
FieldValueProviderBuilder |
restrictive(boolean restrictive)
Sets this
FieldValueProvider 's restrictive flag. |
public static FieldValueProviderBuilder newFieldValueProvider()
FieldValueProvider
.FieldValueProviderBuilder
public FieldValueProviderBuilder addValue(String value)
FieldValueProvider
using the value
itself as the name.value
- the value to addFieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder addValues(Collection<String> values)
FieldValueProvider
using the
values themselves as the names.values
- a Collection
of values to addFieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder addNamedValue(String name, String value)
FieldValueProvider
using the specified
name as its name.name
- the name of the valuevalue
- the value to addFieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder addNamedValues(Map<String,String> namedValues)
FieldValueProvider
.namedValues
- a Map
of named values to addFieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder restrictive()
FieldValueProvider
as restrictive, meaning that the
corresponding field should be restricted to the provided values.FieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder restrictive(boolean restrictive)
FieldValueProvider
's restrictive flag.restrictive
- true
if the field should be restricted to the
provided values (default is false
)FieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder dynamic()
FieldValueProvider
as dynamic, meaning that the
field's values are expected to be calculated at display time.FieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder dynamic(boolean dynamic)
FieldValueProvider
's dynamic flag.dynamic
- true
if the field's values are expected to be calculated
at display time (default is false
)FieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProviderBuilder addContext(String key, String value)
FieldValueProvider
, to be used when calculating
the field's values at display time.key
- the key of the context entryvalue
- the value of the context entryFieldValueProviderBuilder
being used to construct
this FieldValueProvider
public FieldValueProvider build()
FieldValueProvider
using the values provided by
this FieldValueProvider
.FieldValueProvider