Package org.eclipse.ditto.things.model
Interface FeaturesBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Featuresbuild()Creates a newFeaturesobject containing all features which were set to this builder beforehand.java.util.Optional<Feature>get(java.lang.CharSequence featureId)Returns the Feature with the specified identifier from this builder or an empty Optional if such a Feature is unknown to this builder.FeaturesBuilderremove(java.lang.String featureId)Removes the Feature with the given ID from this builder.FeaturesBuilderremove(Feature feature)Removes the given Feature from this builder.FeaturesBuilderremoveAll()Removes all previously set Features.FeaturesBuilderset(Feature feature)Sets the given Feature to this builder.FeaturesBuildersetAll(java.lang.Iterable<Feature> features)Sets all given Features to this builder.
-
-
-
Method Detail
-
set
FeaturesBuilder set(Feature feature)
Sets the given Feature to this builder. A previously set Feature with the same ID is replaced.- Parameters:
feature- the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureisnull.
-
get
java.util.Optional<Feature> get(java.lang.CharSequence featureId)
Returns the Feature with the specified identifier from this builder or an empty Optional if such a Feature is unknown to this builder.- Parameters:
featureId- the identifier of the Feature to be returned.- Returns:
- the Feature with ID
featureIdor an empty Optional.
-
setAll
FeaturesBuilder setAll(java.lang.Iterable<Feature> features)
Sets all given Features to this builder. Each previously set feature with the same ID is replaced.- Parameters:
features- the Features to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeaturesisnull.
-
remove
FeaturesBuilder remove(Feature feature)
Removes the given Feature from this builder. Same likeremove(String).- Parameters:
feature- the Feature to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureisnull.
-
remove
FeaturesBuilder remove(java.lang.String featureId)
Removes the Feature with the given ID from this builder.- Parameters:
featureId- the ID of the Feature to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
removeAll
FeaturesBuilder removeAll()
Removes all previously set Features.- Returns:
- this builder to allow method chaining.
-
-