Package org.eclipse.ditto.things.model
Interface FeaturePropertiesBuilder
-
- All Superinterfaces:
java.lang.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.JsonObjectBuilderA mutable builder for aFeaturePropertieswith a fluent API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description FeaturePropertiesbuild()Creates a newFeaturePropertiesobject containing all values which were set to this builder beforehand.FeaturePropertiesBuilderremove(java.lang.CharSequence key)Removes the property from theFeaturePropertiesto be built which is associated with the given name.FeaturePropertiesBuilderremove(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.FeaturePropertiesBuilderremoveAll()Removes all fields from theFeaturePropertiesto be built.default FeaturePropertiesBuilderset(java.lang.CharSequence key, boolean value)Sets a newbooleanproperty to theFeaturePropertiesto be built.FeaturePropertiesBuilderset(java.lang.CharSequence key, boolean value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets a newbooleanproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.default FeaturePropertiesBuilderset(java.lang.CharSequence key, double value)Sets a newdoubleproperty to theFeaturePropertiesto be built.FeaturePropertiesBuilderset(java.lang.CharSequence key, double value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets a newdoubleproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.default FeaturePropertiesBuilderset(java.lang.CharSequence key, int value)Sets a newintproperty to theFeaturePropertiesto be built.FeaturePropertiesBuilderset(java.lang.CharSequence key, int value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets a newintproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.default FeaturePropertiesBuilderset(java.lang.CharSequence key, long value)Sets a newlongproperty to theFeaturePropertiesto be built.FeaturePropertiesBuilderset(java.lang.CharSequence key, long value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets a newlongproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.default FeaturePropertiesBuilderset(java.lang.CharSequence key, java.lang.String value)Sets a new string property to theFeaturePropertiesto be built.FeaturePropertiesBuilderset(java.lang.CharSequence key, java.lang.String value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets a new string property to theFeaturePropertiesto be built if the specified predicate evaluates totrue.default FeaturePropertiesBuilderset(java.lang.CharSequence key, org.eclipse.ditto.json.JsonValue value)Sets a newJsonValueproperty to theFeaturePropertiesto be built.FeaturePropertiesBuilderset(java.lang.CharSequence key, org.eclipse.ditto.json.JsonValue value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets a newJsonValueproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.default FeaturePropertiesBuilderset(org.eclipse.ditto.json.JsonField field)Sets the specified property to theFeaturePropertiesto be built.default <T> org.eclipse.ditto.json.JsonObjectBuilderset(org.eclipse.ditto.json.JsonFieldDefinition<T> fieldDefinition, T value)<T> FeaturePropertiesBuilderset(org.eclipse.ditto.json.JsonFieldDefinition<T> fieldDefinition, T value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)FeaturePropertiesBuilderset(org.eclipse.ditto.json.JsonField field, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets the specified property to theFeaturePropertiesto be built if the specified predicate evaluates totrue.default FeaturePropertiesBuildersetAll(java.lang.Iterable<org.eclipse.ditto.json.JsonField> fields)Sets the givenJsonFields to theFeaturePropertiesto be built.FeaturePropertiesBuildersetAll(java.lang.Iterable<org.eclipse.ditto.json.JsonField> fields, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)Sets the givenJsonFields to theFeaturePropertiesto be built.
-
-
-
Method Detail
-
set
FeaturePropertiesBuilder set(java.lang.CharSequence key, int value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newintproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
default FeaturePropertiesBuilder set(java.lang.CharSequence key, int value)
Sets a newintproperty to theFeaturePropertiesto be built.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
FeaturePropertiesBuilder set(java.lang.CharSequence key, long value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newlongproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
default FeaturePropertiesBuilder set(java.lang.CharSequence key, long value)
Sets a newlongproperty to theFeaturePropertiesto be built.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
FeaturePropertiesBuilder set(java.lang.CharSequence key, double value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newdoubleproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
default FeaturePropertiesBuilder set(java.lang.CharSequence key, double value)
Sets a newdoubleproperty to theFeaturePropertiesto be built.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
FeaturePropertiesBuilder set(java.lang.CharSequence key, boolean value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newbooleanproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
default FeaturePropertiesBuilder set(java.lang.CharSequence key, boolean value)
Sets a newbooleanproperty to theFeaturePropertiesto be built.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
FeaturePropertiesBuilder set(java.lang.CharSequence key, @Nullable java.lang.String value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a new string property to theFeaturePropertiesto be built if the specified predicate evaluates totrue.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
default FeaturePropertiesBuilder set(java.lang.CharSequence key, @Nullable java.lang.String value)
Sets a new string property to theFeaturePropertiesto be built.- Specified by:
setin 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:
java.lang.NullPointerException- ifnameisnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
FeaturePropertiesBuilder set(java.lang.CharSequence key, org.eclipse.ditto.json.JsonValue value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets a newJsonValueproperty to theFeaturePropertiesto be built if the specified predicate evaluates totrue.- Specified by:
setin 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:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
default FeaturePropertiesBuilder set(java.lang.CharSequence key, org.eclipse.ditto.json.JsonValue value)
Sets a newJsonValueproperty to theFeaturePropertiesto be built.- Specified by:
setin 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:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifnameis empty.
-
set
<T> FeaturePropertiesBuilder set(org.eclipse.ditto.json.JsonFieldDefinition<T> fieldDefinition, @Nullable T value, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
- Specified by:
setin 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:
setin interfaceorg.eclipse.ditto.json.JsonObjectBuilder
-
set
FeaturePropertiesBuilder set(org.eclipse.ditto.json.JsonField field, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets the specified property to theFeaturePropertiesto 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:
setin 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:
java.lang.NullPointerException- iffieldisnull.
-
set
default FeaturePropertiesBuilder set(org.eclipse.ditto.json.JsonField field)
Sets the specified property to theFeaturePropertiesto be built. If this builder already contains a field with the same key, the existing one will be replaced.- Specified by:
setin interfaceorg.eclipse.ditto.json.JsonObjectBuilder- Parameters:
field- the field to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffieldisnull.
-
remove
FeaturePropertiesBuilder remove(java.lang.CharSequence key)
Removes the property from theFeaturePropertiesto be built which is associated with the given name. This method has no effect if no such field exists.- Specified by:
removein interfaceorg.eclipse.ditto.json.JsonObjectBuilder- Parameters:
key- the name of the property to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifnameisnull.
-
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:
removein 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:
java.lang.NullPointerException- iffieldDefinitionisnull.java.lang.IllegalArgumentException- if the JSON pointer offieldDefinitionis empty.
-
setAll
FeaturePropertiesBuilder setAll(java.lang.Iterable<org.eclipse.ditto.json.JsonField> fields, java.util.function.Predicate<org.eclipse.ditto.json.JsonField> predicate)
Sets the givenJsonFields to theFeaturePropertiesto 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:
setAllin 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:
java.lang.NullPointerException- iffieldsisnull.
-
setAll
default FeaturePropertiesBuilder setAll(java.lang.Iterable<org.eclipse.ditto.json.JsonField> fields)
Sets the givenJsonFields to theFeaturePropertiesto 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:
setAllin interfaceorg.eclipse.ditto.json.JsonObjectBuilder- Parameters:
fields- the fields to set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffieldsisnull.
-
removeAll
FeaturePropertiesBuilder removeAll()
Removes all fields from theFeaturePropertiesto be built.- Specified by:
removeAllin interfaceorg.eclipse.ditto.json.JsonObjectBuilder- Returns:
- this builder to allow method chaining.
-
build
FeatureProperties build()
Creates a newFeaturePropertiesobject containing all values which were set to this builder beforehand.- Specified by:
buildin interfaceorg.eclipse.ditto.json.JsonObjectBuilder- Returns:
- a new FeatureProperties object.
- Throws:
org.eclipse.ditto.json.JsonKeyInvalidException- if a property name in the passedjsonObjectwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
-