Interface Feature
- All Superinterfaces:
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>
A Feature is used to manage all data and functionality of a Thing that can be clustered in an outlined
technical context.
For different contexts or aspects of a Thing, different Features can be used which are all belonging to the same Thing and do not exists without this Thing.
The data related to Features is managed in form of FeatureProperties. These properties can
be categorized, e. g. to manage the status, the configuration or any fault information.
For Ditto to be able to work with models/concepts of a Feature (e. g. syntactically validate
properties of Features or provide detailed information about message parameters, etc.) it is possible to attach a
FeatureDefinition. The Definition can be compared to interface declarations in programming languages
(with the difference that in programming languages the type system is fully known where as in Ditto the semantics of
definitions is not fixed but depends on different usage scenarios like for example validation, mapping, ...).
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAn enumeration of the knownJsonFields of a Feature.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 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 Object> -
Method Summary
Modifier and TypeMethodDescriptionReturns the attached Definition of this Feature.Returns the desired properties of this Feature.default Optional<org.eclipse.ditto.json.JsonValue>getDesiredProperty(CharSequence pointer) Gets the desired property value which is referred by the given JSON Pointer.Optional<org.eclipse.ditto.json.JsonValue>getDesiredProperty(org.eclipse.ditto.json.JsonPointer pointer) Gets the desired property value which is referred by the given JSON Pointer.getId()Returns the ID of this Feature.Returns the properties of this Feature.default Optional<org.eclipse.ditto.json.JsonValue>getProperty(CharSequence pointer) Gets the property value which is referred by the given JSON Pointer.Optional<org.eclipse.ditto.json.JsonValue>getProperty(org.eclipse.ditto.json.JsonPointer pointer) Gets the property value which is referred by the given JSON Pointer.Returns a new empty builder for an immutableFeature.Removes the Definition from a copy of this Feature.Removes all desired properties on a copy of this Feature.default FeatureremoveDesiredProperty(CharSequence pointer) Removes the desired property specified by a JSON Pointer from a copy of this Feature.removeDesiredProperty(org.eclipse.ditto.json.JsonPointer pointer) Removes the desired property specified by a JSON Pointer from a copy of this Feature.Removes all properties on a copy of this Feature.default FeatureremoveProperty(CharSequence pointer) Removes the property specified by a JSON Pointer from a copy of this Feature.removeProperty(org.eclipse.ditto.json.JsonPointer pointer) Removes the property specified by a JSON Pointer from a copy of this Feature.setDefinition(FeatureDefinition featureDefinition) Sets the specified Definition to a copy of this Feature.setDesiredProperties(FeatureProperties desiredProperties) Sets the given desired properties to a copy of this Feature.default FeaturesetDesiredProperty(CharSequence pointer, boolean desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(CharSequence pointer, double desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(CharSequence pointer, int desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(CharSequence pointer, long desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(CharSequence pointer, String desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(CharSequence pointer, org.eclipse.ditto.json.JsonValue desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.setDesiredProperty(org.eclipse.ditto.json.JsonPointer pointer, org.eclipse.ditto.json.JsonValue desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.setProperties(FeatureProperties properties) Sets the given properties to a copy of this Feature.default FeaturesetProperty(CharSequence pointer, boolean propertyValue) Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(CharSequence pointer, double propertyValue) Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(CharSequence pointer, int propertyValue) Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(CharSequence pointer, long propertyValue) Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(CharSequence pointer, String propertyValue) Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(CharSequence pointer, org.eclipse.ditto.json.JsonValue propertyValue) Sets the value of a property which is referred by the given JSON Pointer.setProperty(org.eclipse.ditto.json.JsonPointer pointer, org.eclipse.ditto.json.JsonValue propertyValue) Sets the value of a property which is referred by the given JSON Pointer.default FeatureBuilder.FromCopyBuildableReturns a new builder for an immutableFeaturewhich is initialised with the values of the this Feature object.default org.eclipse.ditto.json.JsonObjecttoJson()Returns all non-hidden marked fields of this Feature.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, toJsonStringMethods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector
toJson, toJson, toJson, toJsonString, toJsonStringMethods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate
toJson, toJson, toJsonString, toJsonStringMethods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer
toJsonString, toJsonStringMethods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithPredicate
toJson, toJson, toJsonString, toJsonString
-
Method Details
-
newBuilder
Returns a new empty builder for an immutableFeature.- Returns:
- the builder.
-
toBuilder
Returns a new builder for an immutableFeaturewhich is initialised with the values of the this Feature object.- Returns:
- the new builder.
-
getId
String getId()Returns the ID of this Feature.- Returns:
- the ID of this Feature.
-
getDefinition
Optional<FeatureDefinition> getDefinition()Returns the attached Definition of this Feature.- Returns:
- the Definition or an empty Optional.
-
setDefinition
Sets the specified Definition to a copy of this Feature.- Parameters:
featureDefinition- the Definition to be attached to a copy of this Feature.- Returns:
- a copy of this Feature with the specified Definition attached or this Feature instance if the specified Definition was already set.
- Throws:
NullPointerException- iffeatureDefinitionisnull.
-
removeDefinition
Feature removeDefinition()Removes the Definition from a copy of this Feature.- Returns:
- a copy of this Feature without a Definition or this Feature instance if this feature was already without Definition.
-
getProperties
Optional<FeatureProperties> getProperties()Returns the properties of this Feature.- Returns:
- the properties of this Feature.
-
setProperties
Sets the given properties to a copy of this Feature. The previous properties of the Feature are overwritten.- Parameters:
properties- the properties to be set.- Returns:
- a copy of this Feature with the given properties.
- Throws:
NullPointerException- ifpropertiesisnull.
-
removeProperties
Feature removeProperties()Removes all properties on a copy of this Feature.- Returns:
- a copy of this Feature with all of its properties removed.
-
getProperty
Gets the property value which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be returned.- Returns:
- the value of the property which is referred by
pointer. - Throws:
NullPointerException- ifpointerisnull.
-
getProperty
Gets the property value which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be returned.- Returns:
- the value of the property which is referred by
pointer. - Throws:
NullPointerException- ifpointerisnull.
-
setProperty
Sets the value of a property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given property value set.
- Throws:
NullPointerException- if any argument isnull.
-
setProperty
Sets the value of a property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given property value set.
- Throws:
NullPointerException- if any argument isnull.
-
setProperty
Sets the value of a property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given property value set.
- Throws:
NullPointerException- if any argument isnull.
-
setProperty
Sets the value of a property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given property value set.
- Throws:
NullPointerException- if any argument isnull.
-
setProperty
Sets the value of a property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given property value set.
- Throws:
NullPointerException- if any argument isnull.
-
setProperty
Sets the value of a property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given property value set.
- Throws:
NullPointerException- if any argument isnull.
-
setProperty
Feature setProperty(org.eclipse.ditto.json.JsonPointer pointer, org.eclipse.ditto.json.JsonValue propertyValue) Sets the value of a property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the property value to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given property value set.
- Throws:
NullPointerException- if any argument isnull.
-
removeProperty
Removes the property specified by a JSON Pointer from a copy of this Feature.- Parameters:
pointer- defines the hierarchical path to the property to be removed.- Returns:
- a copy of this Feature with the specified property removed.
- Throws:
NullPointerException- ifpointerisnull.
-
removeProperty
Removes the property specified by a JSON Pointer from a copy of this Feature.- Parameters:
pointer- defines the hierarchical path to the property to be removed.- Returns:
- a copy of this Feature with the specified property removed.
- Throws:
NullPointerException- ifpointerisnull.
-
getDesiredProperties
Optional<FeatureProperties> getDesiredProperties()Returns the desired properties of this Feature.- Returns:
- the desired properties of this Feature.
- Since:
- 1.5.0
-
setDesiredProperties
Sets the given desired properties to a copy of this Feature. The previous desired properties of the Feature are overwritten.- Parameters:
desiredProperties- the desired properties to be set.- Returns:
- a copy of this Feature with the given properties.
- Throws:
NullPointerException- ifdesiredPropertiesisnull.- Since:
- 1.5.0
-
removeDesiredProperties
Feature removeDesiredProperties()Removes all desired properties on a copy of this Feature.- Returns:
- a copy of this Feature with all of its desired properties removed.
- Since:
- 1.5.0
-
getDesiredProperty
Gets the desired property value which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be returned.- Returns:
- the value of the desired property which is referred by
pointer. - Throws:
NullPointerException- ifpointerisnull.- Since:
- 1.5.0
-
getDesiredProperty
Optional<org.eclipse.ditto.json.JsonValue> getDesiredProperty(org.eclipse.ditto.json.JsonPointer pointer) Gets the desired property value which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be returned.- Returns:
- the value of the desired property which is referred by
pointer. - Throws:
NullPointerException- ifpointerisnull.- Since:
- 1.5.0
-
setDesiredProperty
default Feature setDesiredProperty(CharSequence pointer, org.eclipse.ditto.json.JsonValue desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be set.desiredPropertyValue- the desired property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
Sets the value of a desired property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be set.desiredPropertyValue- the desired property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
Sets the value of a desired property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be set.desiredPropertyValue- the desired property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
Sets the value of a desired property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be set.desiredPropertyValue- the property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
Sets the value of a desired property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be set.desiredPropertyValue- the desired property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
Sets the value of a desired property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be set.desiredPropertyValue- the desired property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
Feature setDesiredProperty(org.eclipse.ditto.json.JsonPointer pointer, org.eclipse.ditto.json.JsonValue desiredPropertyValue) Sets the value of a desired property which is referred by the given JSON Pointer.- Parameters:
pointer- defines the hierarchical path to the desired property value to be set.desiredPropertyValue- the desired property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeDesiredProperty
Removes the desired property specified by a JSON Pointer from a copy of this Feature.- Parameters:
pointer- defines the hierarchical path to the desired property to be removed.- Returns:
- a copy of this Feature with the specified desired property removed.
- Throws:
NullPointerException- ifpointerisnull.- Since:
- 1.5.0
-
removeDesiredProperty
Removes the desired property specified by a JSON Pointer from a copy of this Feature.- Parameters:
pointer- defines the hierarchical path to the desired property to be removed.- Returns:
- a copy of this Feature with the specified desired property removed.
- Throws:
NullPointerException- ifpointerisnull.- Since:
- 1.5.0
-
toJson
default org.eclipse.ditto.json.JsonObject toJson()Returns all non-hidden marked fields of this Feature.- Specified by:
toJsonin interfaceorg.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>- Returns:
- a JSON object representation of this Feature 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
-