Package org.eclipse.ditto.model.things
Interface FeaturePropertiesBuilder
-
- All Superinterfaces:
Iterable<org.eclipse.ditto.json.JsonField>
,org.eclipse.ditto.json.JsonObjectBuilder
,org.eclipse.ditto.json.JsonValueContainer<org.eclipse.ditto.json.JsonField>
@NotThreadSafe public interface FeaturePropertiesBuilder extends org.eclipse.ditto.json.JsonObjectBuilder
A mutable builder for aFeatureProperties
with a fluent API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FeatureProperties
build()
Creates a newFeatureProperties
object containing all values which were set to this builder beforehand.FeaturePropertiesBuilder
remove(CharSequence key)
Removes the property from theFeatureProperties
to be built which is associated with the given name.FeaturePropertiesBuilder
remove(org.eclipse.ditto.json.JsonFieldDefinition fieldDefinition)
Removes the property from the @code FeatureProperties} to be built which is associated with the pointer of the specified JSON field definition.FeaturePropertiesBuilder
removeAll()
Removes all fields from theFeatureProperties
to be built.default FeaturePropertiesBuilder
set(CharSequence key, boolean value)
Sets a newboolean
property to theFeatureProperties
to be built.FeaturePropertiesBuilder
set(CharSequence key, boolean value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newboolean
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.default FeaturePropertiesBuilder
set(CharSequence key, double value)
Sets a newdouble
property to theFeatureProperties
to be built.FeaturePropertiesBuilder
set(CharSequence key, double value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newdouble
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.default FeaturePropertiesBuilder
set(CharSequence key, int value)
Sets a newint
property to theFeatureProperties
to be built.FeaturePropertiesBuilder
set(CharSequence key, int value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newint
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.default FeaturePropertiesBuilder
set(CharSequence key, long value)
Sets a newlong
property to theFeatureProperties
to be built.FeaturePropertiesBuilder
set(CharSequence key, long value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newlong
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.default FeaturePropertiesBuilder
set(CharSequence key, String value)
Sets a new string property to theFeatureProperties
to be built.FeaturePropertiesBuilder
set(CharSequence key, String value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a new string property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.default FeaturePropertiesBuilder
set(CharSequence key, org.eclipse.ditto.json.JsonValue value)
Sets a newJsonValue
property to theFeatureProperties
to be built.FeaturePropertiesBuilder
set(CharSequence key, org.eclipse.ditto.json.JsonValue value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newJsonValue
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.default FeaturePropertiesBuilder
set(org.eclipse.ditto.json.JsonField field)
Sets the specified property to theFeatureProperties
to be built.default <T> org.eclipse.ditto.json.JsonObjectBuilder
set(org.eclipse.ditto.json.JsonFieldDefinition<T> fieldDefinition, T value)
<T> FeaturePropertiesBuilder
set(org.eclipse.ditto.json.JsonFieldDefinition<T> fieldDefinition, T value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
FeaturePropertiesBuilder
set(org.eclipse.ditto.json.JsonField field, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets the specified property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.default FeaturePropertiesBuilder
setAll(Iterable<org.eclipse.ditto.json.JsonField> fields)
Sets the givenJsonField
s to theFeatureProperties
to be built.FeaturePropertiesBuilder
setAll(Iterable<org.eclipse.ditto.json.JsonField> fields, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets the givenJsonField
s to theFeatureProperties
to be built.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
set
FeaturePropertiesBuilder set(CharSequence key, int value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newint
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.predicate
- the predicate which finally determines if the property is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
default FeaturePropertiesBuilder set(CharSequence key, int value)
Sets a newint
property to theFeatureProperties
to be built.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
FeaturePropertiesBuilder set(CharSequence key, long value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newlong
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.predicate
- the predicate which finally determines if the property is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
default FeaturePropertiesBuilder set(CharSequence key, long value)
Sets a newlong
property to theFeatureProperties
to be built.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
FeaturePropertiesBuilder set(CharSequence key, double value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newdouble
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.predicate
- the predicate which finally determines if the property is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
default FeaturePropertiesBuilder set(CharSequence key, double value)
Sets a newdouble
property to theFeatureProperties
to be built.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
FeaturePropertiesBuilder set(CharSequence key, boolean value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newboolean
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.predicate
- the predicate which finally determines if the property is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
default FeaturePropertiesBuilder set(CharSequence key, boolean value)
Sets a newboolean
property to theFeatureProperties
to be built.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
FeaturePropertiesBuilder set(CharSequence key, @Nullable String value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a new string property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.predicate
- the predicate which finally determines if the property is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
default FeaturePropertiesBuilder set(CharSequence key, @Nullable String value)
Sets a new string property to theFeatureProperties
to be built.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.IllegalArgumentException
- ifname
is empty.
-
set
FeaturePropertiesBuilder set(CharSequence key, org.eclipse.ditto.json.JsonValue value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newJsonValue
property to theFeatureProperties
to be built if the specified predicate evaluates totrue
.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.predicate
- the predicate which finally determines if the property is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- if any argument isnull
.IllegalArgumentException
- ifname
is empty.
-
set
default FeaturePropertiesBuilder set(CharSequence key, org.eclipse.ditto.json.JsonValue value)
Sets a newJsonValue
property to theFeatureProperties
to be built.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be set.value
- the value of the property to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- if any argument isnull
.IllegalArgumentException
- ifname
is empty.
-
set
<T> FeaturePropertiesBuilder set(org.eclipse.ditto.json.JsonFieldDefinition<T> fieldDefinition, @Nullable T value, Predicate<org.eclipse.ditto.json.JsonField> predicate)
- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
-
set
default <T> org.eclipse.ditto.json.JsonObjectBuilder set(org.eclipse.ditto.json.JsonFieldDefinition<T> fieldDefinition, @Nullable T value)
- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
-
set
FeaturePropertiesBuilder set(org.eclipse.ditto.json.JsonField field, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets the specified property to theFeatureProperties
to be built if the specified predicate evaluates totrue
. If this builder already contains a field with the same key, the existing one will be replaced.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
field
- the field to be set.predicate
- the predicate which finally determines if the property is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- iffield
isnull
.
-
set
default FeaturePropertiesBuilder set(org.eclipse.ditto.json.JsonField field)
Sets the specified property to theFeatureProperties
to be built. If this builder already contains a field with the same key, the existing one will be replaced.- Specified by:
set
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
field
- the field to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- iffield
isnull
.
-
remove
FeaturePropertiesBuilder remove(CharSequence key)
Removes the property from theFeatureProperties
to be built which is associated with the given name. This method has no effect if no such field exists.- Specified by:
remove
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
key
- the name of the property to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifname
isnull
.
-
remove
FeaturePropertiesBuilder remove(org.eclipse.ditto.json.JsonFieldDefinition fieldDefinition)
Removes the property from the @code FeatureProperties} to be built which is associated with the pointer of the specified JSON field definition. This method has no effect if no such field exists.- Specified by:
remove
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
fieldDefinition
- provides the JSON pointer of the property to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- iffieldDefinition
isnull
.IllegalArgumentException
- if the JSON pointer offieldDefinition
is empty.
-
setAll
FeaturePropertiesBuilder setAll(Iterable<org.eclipse.ditto.json.JsonField> fields, Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets the givenJsonField
s to theFeatureProperties
to be built. This method prevents duplicates, i. e. if two fields have the same key, the previous field is replaced by the new field; the position of the new field in the resulting JSON object is the same as the position of the previous field. For each field applies that the field is only set if the specified predicate evaluates totrue
.- Specified by:
setAll
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
fields
- the fields to set.predicate
- the predicate which finally determines for each field if it is to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- iffields
isnull
.
-
setAll
default FeaturePropertiesBuilder setAll(Iterable<org.eclipse.ditto.json.JsonField> fields)
Sets the givenJsonField
s to theFeatureProperties
to be built. This method prevents duplicates, i. e. if two fields have the same key, the previous field is replaced by the new field; the position of the new field in the resulting JSON object is the same as the position of the previous field.- Specified by:
setAll
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Parameters:
fields
- the fields to set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- iffields
isnull
.
-
removeAll
FeaturePropertiesBuilder removeAll()
Removes all fields from theFeatureProperties
to be built.- Specified by:
removeAll
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Returns:
- this builder to allow method chaining.
-
build
FeatureProperties build()
Creates a newFeatureProperties
object containing all values which were set to this builder beforehand.- Specified by:
build
in interfaceorg.eclipse.ditto.json.JsonObjectBuilder
- Returns:
- a new FeatureProperties object.
-
-