Package org.eclipse.ditto.things.model
Interface Features
-
- All Superinterfaces:
java.lang.Iterable<Feature>,org.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>,org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector,org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>,org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer<org.eclipse.ditto.json.JsonObject>,org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<org.eclipse.ditto.json.JsonObject,org.eclipse.ditto.json.JsonField>
@Immutable public interface Features extends java.lang.Iterable<Feature>, org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector, org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<T extends java.lang.Object>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer<J extends org.eclipse.ditto.json.JsonValue>, org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate<J extends org.eclipse.ditto.json.JsonValue,T extends java.lang.Object>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Optional<Feature>getFeature(java.lang.String featureId)Returns the Feature with the given ID or an empty optional.intgetSize()Returns the size of this Features, i.booleanisEmpty()Indicates whether this Features is empty.default booleanisNull()Indicates whether this Features are equivalent to semanticnull.static FeaturesBuildernewBuilder()Returns a new mutable builder with a fluent API for an immutableFeatures.FeaturesremoveDefinition(java.lang.String featureId)Removes the definition from the Feature with the given ID from a copy of this Features.FeaturesremoveDesiredProperties(java.lang.CharSequence featureId)Removes all desired properties of the Feature with the given ID from a copy of this Features.FeaturesremoveDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath)Removes the desired property which is referred by the given JSON Pointer from the Feature with the given ID on a copy of this Features..FeaturesremoveFeature(java.lang.String featureId)Removes the Feature with the given ID from a copy of this Features.FeaturesremoveProperties(java.lang.String featureId)Removes all properties of the Feature with the given ID from a copy of this Features.FeaturesremoveProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)Removes the property which is referred by the given JSON Pointer from the Feature with the given ID on a copy of this Features..FeaturessetDefinition(java.lang.String featureId, FeatureDefinition definition)Sets the given definition for the Feature with the given ID on a copy of this Features.FeaturessetDesiredProperties(java.lang.CharSequence featureId, FeatureProperties desiredProperties)Sets the given desired properties for the Feature with the given ID on a copy of this Features.FeaturessetDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath, org.eclipse.ditto.json.JsonValue desiredPropertyValue)Sets the value of the desired property which is referred by the given JSON Pointer of the Feature with the given ID on a copy of this Features.FeaturessetFeature(Feature feature)Sets the given Feature to a copy of this Features.FeaturessetProperties(java.lang.String featureId, FeatureProperties properties)Sets the given properties for the Feature with the given ID on a copy of this Features.FeaturessetProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath, org.eclipse.ditto.json.JsonValue propertyValue)Sets the value of the property which is referred by the given JSON Pointer of the Feature with the given ID on a copy of this Features.java.util.stream.Stream<Feature>stream()Returns a sequentialStreamwith the values of this Features as its source.default FeaturesBuildertoBuilder()Returns a new mutable builder with a fluent API for an immutableFeatures.default org.eclipse.ditto.json.JsonObjecttoJson()Returns all non hidden marked fields of this Features.default org.eclipse.ditto.json.JsonObjecttoJson(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, org.eclipse.ditto.json.JsonFieldSelector fieldSelector)-
Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
getImplementedSchemaVersion, getLatestSchemaVersion, getSupportedSchemaVersions, implementsSchemaVersion, implementsSchemaVersion, toJsonString
-
Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector
toJson, toJson, toJson, toJsonString, toJsonString
-
Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate
toJson, toJson, toJsonString, toJsonString
-
-
-
-
Method Detail
-
newBuilder
static FeaturesBuilder newBuilder()
Returns a new mutable builder with a fluent API for an immutableFeatures.- Returns:
- the builder.
-
toBuilder
default FeaturesBuilder toBuilder()
Returns a new mutable builder with a fluent API for an immutableFeatures. The builder is initialised with the features of this instance.- Returns:
- the builder.
-
getFeature
java.util.Optional<Feature> getFeature(java.lang.String featureId)
Returns the Feature with the given ID or an empty optional.- Parameters:
featureId- the ID of the Feature to be retrieved.- Returns:
- the Feature with the given ID or an empty optional.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setFeature
Features setFeature(Feature feature)
Sets the given Feature to a copy of this Features. A previous Feature with the same ID will be overwritten.- Parameters:
feature- the Feature to be set.- Returns:
- a copy of this Features with
featureset. - Throws:
java.lang.NullPointerException- iffeatureisnull.
-
removeFeature
Features removeFeature(java.lang.String featureId)
Removes the Feature with the given ID from a copy of this Features.- Parameters:
featureId- the ID of the Feature to be removed.- Returns:
- a copy of this Features with
featureremoved. - Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setDefinition
Features setDefinition(java.lang.String featureId, FeatureDefinition definition)
Sets the given definition for the Feature with the given ID on a copy of this Features. The previous definition of a Feature with the same ID is overwritten.- Parameters:
featureId- the ID of the Feature for which the definition is set.definition- the definition to be set.- Returns:
- a copy of this Features with the definition set.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeDefinition
Features removeDefinition(java.lang.String featureId)
Removes the definition from the Feature with the given ID from a copy of this Features.- Parameters:
featureId- the ID of the Feature from which the definition is removed.- Returns:
- a copy of this Features with the definition of the Feature with
featureIdremoved. - Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setProperties
Features setProperties(java.lang.String featureId, FeatureProperties properties)
Sets the given properties for the Feature with the given ID on a copy of this Features. The previous properties of a Feature with the same ID are overwritten.- Parameters:
featureId- the ID of the Feature for which the properties are set.properties- the properties to be set.- Returns:
- a copy of this Features with the property set.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeProperties
Features removeProperties(java.lang.String featureId)
Removes all properties of the Feature with the given ID from a copy of this Features.- Parameters:
featureId- the ID of the Feature from which all properties are removed.- Returns:
- a copy of this Features with all properties of the Feature with
featureIdremoved. - Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setProperty
Features setProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath, org.eclipse.ditto.json.JsonValue propertyValue)
Sets the value of the property which is referred by the given JSON Pointer of the Feature with the given ID on a copy of this Features. The value of a previous property at the pointed position is overwritten.- Parameters:
featureId- the ID of the Feature of which the property is set.propertyPath- defines the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Features with the property set.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeProperty
Features removeProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)
Removes the property which is referred by the given JSON Pointer from the Feature with the given ID on a copy of this Features..- Parameters:
featureId- the ID of the Feature from which the property is removed.propertyPath- defines the hierarchical path within the Feature to the property to be removed.- Returns:
- a copy of this Features with the given property removed.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setDesiredProperties
Features setDesiredProperties(java.lang.CharSequence featureId, FeatureProperties desiredProperties)
Sets the given desired properties for the Feature with the given ID on a copy of this Features. The previous desired properties of a Feature with the same ID are overwritten.- Parameters:
featureId- the ID of the Feature for which the desired properties are set.desiredProperties- the properties to be set.- Returns:
- a copy of this Features with the desired property set.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeDesiredProperties
Features removeDesiredProperties(java.lang.CharSequence featureId)
Removes all desired properties of the Feature with the given ID from a copy of this Features.- Parameters:
featureId- the ID of the Feature from which all desired properties are removed.- Returns:
- a copy of this Features with all desired properties of the Feature with
featureIdremoved. - Throws:
java.lang.NullPointerException- iffeatureIdisnull.- Since:
- 1.5.0
-
setDesiredProperty
Features setDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath, org.eclipse.ditto.json.JsonValue desiredPropertyValue)
Sets the value of the desired property which is referred by the given JSON Pointer of the Feature with the given ID on a copy of this Features. The value of a previous desired property at the pointed position is overwritten.- Parameters:
featureId- the ID of the Feature of which the desired property is set.desiredPropertyPath- defines the hierarchical path within the Feature to the desired property to be set.desiredPropertyValue- the desired property value to be set.- Returns:
- a copy of this Features with the desired property set.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeDesiredProperty
Features removeDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath)
Removes the desired property which is referred by the given JSON Pointer from the Feature with the given ID on a copy of this Features..- Parameters:
featureId- the ID of the Feature from which the desired property is removed.desiredPropertyPath- defines the hierarchical path within the Feature to the desired property to be removed.- Returns:
- a copy of this Features with the given desired property removed.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
isNull
default boolean isNull()
Indicates whether this Features are equivalent to semanticnull.- Returns:
trueif this Features are semanticallynull,falseelse.
-
getSize
int getSize()
Returns the size of this Features, i. e. the number of contained values.- Returns:
- the number of Features.
-
isEmpty
boolean isEmpty()
Indicates whether this Features is empty.- Returns:
trueif this Features does not contain any values,falseelse.
-
stream
java.util.stream.Stream<Feature> stream()
Returns a sequentialStreamwith the values of this Features as its source.- Returns:
- a sequential stream of the Features of this container.
-
toJson
default org.eclipse.ditto.json.JsonObject toJson()
Returns all non hidden marked fields of this Features.- Specified by:
toJsonin interfaceorg.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>- Returns:
- a JSON object representation of this Features including only non hidden marked fields.
-
toJson
default org.eclipse.ditto.json.JsonObject toJson(org.eclipse.ditto.base.model.json.JsonSchemaVersion schemaVersion, org.eclipse.ditto.json.JsonFieldSelector fieldSelector)- Specified by:
toJsonin interfaceorg.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector
-
-