Package org.eclipse.ditto.model.things
Interface FeaturesBuilder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Features
build()
Creates a newFeatures
object containing all features which were set to this builder beforehand.Optional<Feature>
get(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.FeaturesBuilder
remove(String featureId)
Removes the Feature with the given ID from this builder.FeaturesBuilder
remove(Feature feature)
Removes the given Feature from this builder.FeaturesBuilder
removeAll()
Removes all previously set Features.FeaturesBuilder
set(Feature feature)
Sets the given Feature to this builder.FeaturesBuilder
setAll(Iterable<Feature> features)
Sets all given Features to this builder.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
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:
NullPointerException
- iffeature
isnull
.
-
get
Optional<Feature> get(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
featureId
or an empty Optional.
-
setAll
FeaturesBuilder setAll(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:
NullPointerException
- iffeatures
isnull
.
-
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:
NullPointerException
- iffeature
isnull
.
-
remove
FeaturesBuilder remove(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:
NullPointerException
- iffeatureId
isnull
.
-
removeAll
FeaturesBuilder removeAll()
Removes all previously set Features.- Returns:
- this builder to allow method chaining.
-
-