Package org.eclipse.ditto.things.model
Interface FeatureBuilder.FromCopyBuildable
-
- Enclosing interface:
- FeatureBuilder
@NotThreadSafe public static interface FeatureBuilder.FromCopyBuildableA mutable builder with a fluent API for an immutableFeature. This builder is initialised with the properties of an existing Feature.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Featurebuild()Creates a new Feature object based on the data which was provided to this builder.FeatureBuilder.FromCopyBuildabledefinition(FeatureDefinition featureDefinition)Sets the specified Definition to the Feature to be built.FeatureBuilder.FromCopyBuildabledesiredProperties(java.util.function.UnaryOperator<FeatureProperties> transform)Calls the giventransformfunction with the currently set desired properties of this builder.FeatureBuilder.FromCopyBuildabledesiredProperties(org.eclipse.ditto.json.JsonObject desiredProperties)Sets the desired properties of the Feature.FeatureBuilder.FromCopyBuildabledesiredProperties(FeatureProperties desiredProperties)Sets the desired properties of the Feature.FeatureBuilder.FromCopyBuildableproperties(java.util.function.Function<FeatureProperties,FeatureProperties> transform)Calls the giventransformfunction with the currently set properties of this builder.FeatureBuilder.FromCopyBuildableproperties(org.eclipse.ditto.json.JsonObject properties)Sets the properties of the Feature.FeatureBuilder.FromCopyBuildableproperties(FeatureProperties properties)Sets the properties of the Feature.default FeatureBuilder.FromCopyBuildablesetId(java.lang.String featureId)Sets the given Feature ID to this builder.FeatureBuilder.FromCopyBuildablesetId(java.util.function.Predicate<java.lang.String> existingIdPredicate, java.lang.String featureId)Sets the given Feature ID to this builder.
-
-
-
Method Detail
-
definition
FeatureBuilder.FromCopyBuildable definition(@Nullable FeatureDefinition featureDefinition)
Sets the specified Definition to the Feature to be built.- Parameters:
featureDefinition- the Definition to be set ornull.- Returns:
- this builder to allow method chaining.
-
properties
FeatureBuilder.FromCopyBuildable properties(@Nullable FeatureProperties properties)
Sets the properties of the Feature.- Parameters:
properties- the properties of the Feature to be created ornull.- Returns:
- this builder to allow method chaining.
-
properties
FeatureBuilder.FromCopyBuildable properties(@Nullable org.eclipse.ditto.json.JsonObject properties)
Sets the properties of the Feature.- Parameters:
properties- the properties of the Feature to be created ornull.- Returns:
- this builder to allow method chaining.
-
properties
FeatureBuilder.FromCopyBuildable properties(java.util.function.Function<FeatureProperties,FeatureProperties> transform)
Calls the giventransformfunction with the currently set properties of this builder. The result of thetransformfunction is set as new properties of the Feature to be built.- Parameters:
transform- the function to transform the current properties of the Feature to be created. If there are no properties set yet, the function is called with empty properties.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iftransformisnull.
-
desiredProperties
FeatureBuilder.FromCopyBuildable desiredProperties(@Nullable FeatureProperties desiredProperties)
Sets the desired properties of the Feature.- Parameters:
desiredProperties- the desired properties of the Feature to be created ornull.- Returns:
- this builder to allow method chaining.
- Since:
- 1.5.0
-
desiredProperties
FeatureBuilder.FromCopyBuildable desiredProperties(@Nullable org.eclipse.ditto.json.JsonObject desiredProperties)
Sets the desired properties of the Feature.- Parameters:
desiredProperties- the desired properties of the Feature to be created ornull.- Returns:
- this builder to allow method chaining.
- Since:
- 1.5.0
-
desiredProperties
FeatureBuilder.FromCopyBuildable desiredProperties(java.util.function.UnaryOperator<FeatureProperties> transform)
Calls the giventransformfunction with the currently set desired properties of this builder. The result of thetransformfunction is set as new desired properties of the Feature to be built.- Parameters:
transform- the function to transform the current desired properties of the Feature to be created. If there are no desired properties set yet, the function is called with empty desired properties.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iftransformisnull.- Since:
- 1.5.0
-
setId
default FeatureBuilder.FromCopyBuildable setId(java.lang.String featureId)
Sets the given Feature ID to this builder.- Parameters:
featureId- the Feature ID to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.java.lang.IllegalArgumentException- iffeatureIdis empty.
-
setId
FeatureBuilder.FromCopyBuildable setId(java.util.function.Predicate<java.lang.String> existingIdPredicate, java.lang.String featureId)
Sets the given Feature ID to this builder.- Parameters:
existingIdPredicate- a predicate to decide whether the given ID is set. The predicate receives the currently set Feature ID.featureId- the Feature ID to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- iffeatureIdis empty.
-
build
Feature build()
Creates a new Feature object based on the data which was provided to this builder.- Returns:
- a new Feature object.
-
-