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>
@Immutable public interface Feature extends org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelectorAndPredicate<org.eclipse.ditto.json.JsonField>A Feature is used to manage all data and functionality of a
Thingthat 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 Classes Modifier and Type Interface Description static classFeature.JsonFieldsAn 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 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<FeatureDefinition>getDefinition()Returns the attached Definition of this Feature.java.util.Optional<FeatureProperties>getDesiredProperties()Returns the desired properties of this Feature.default java.util.Optional<org.eclipse.ditto.json.JsonValue>getDesiredProperty(java.lang.CharSequence pointer)Gets the desired property value which is referred by the given JSON Pointer.java.util.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.java.lang.StringgetId()Returns the ID of this Feature.java.util.Optional<FeatureProperties>getProperties()Returns the properties of this Feature.default java.util.Optional<org.eclipse.ditto.json.JsonValue>getProperty(java.lang.CharSequence pointer)Gets the property value which is referred by the given JSON Pointer.java.util.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.static FeatureBuilder.FromScratchBuildablenewBuilder()Returns a new empty builder for an immutableFeature.FeatureremoveDefinition()Removes the Definition from a copy of this Feature.FeatureremoveDesiredProperties()Removes all desired properties on a copy of this Feature.default FeatureremoveDesiredProperty(java.lang.CharSequence pointer)Removes the desired property specified by a JSON Pointer from a copy of this Feature.FeatureremoveDesiredProperty(org.eclipse.ditto.json.JsonPointer pointer)Removes the desired property specified by a JSON Pointer from a copy of this Feature.FeatureremoveProperties()Removes all properties on a copy of this Feature.default FeatureremoveProperty(java.lang.CharSequence pointer)Removes the property specified by a JSON Pointer from a copy of this Feature.FeatureremoveProperty(org.eclipse.ditto.json.JsonPointer pointer)Removes the property specified by a JSON Pointer from a copy of this Feature.FeaturesetDefinition(FeatureDefinition featureDefinition)Sets the specified Definition to a copy of this Feature.FeaturesetDesiredProperties(FeatureProperties desiredProperties)Sets the given desired properties to a copy of this Feature.default FeaturesetDesiredProperty(java.lang.CharSequence pointer, boolean desiredPropertyValue)Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(java.lang.CharSequence pointer, double desiredPropertyValue)Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(java.lang.CharSequence pointer, int desiredPropertyValue)Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(java.lang.CharSequence pointer, long desiredPropertyValue)Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(java.lang.CharSequence pointer, java.lang.String desiredPropertyValue)Sets the value of a desired property which is referred by the given JSON Pointer.default FeaturesetDesiredProperty(java.lang.CharSequence pointer, org.eclipse.ditto.json.JsonValue desiredPropertyValue)Sets the value of a desired property which is referred by the given JSON Pointer.FeaturesetDesiredProperty(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.FeaturesetProperties(FeatureProperties properties)Sets the given properties to a copy of this Feature.default FeaturesetProperty(java.lang.CharSequence pointer, boolean propertyValue)Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(java.lang.CharSequence pointer, double propertyValue)Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(java.lang.CharSequence pointer, int propertyValue)Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(java.lang.CharSequence pointer, long propertyValue)Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(java.lang.CharSequence pointer, java.lang.String propertyValue)Sets the value of a property which is referred by the given JSON Pointer.default FeaturesetProperty(java.lang.CharSequence pointer, org.eclipse.ditto.json.JsonValue propertyValue)Sets the value of a property which is referred by the given JSON Pointer.FeaturesetProperty(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.FromCopyBuildabletoBuilder()Returns 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, 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 FeatureBuilder.FromScratchBuildable newBuilder()
Returns a new empty builder for an immutableFeature.- Returns:
- the builder.
-
toBuilder
default FeatureBuilder.FromCopyBuildable toBuilder()
Returns a new builder for an immutableFeaturewhich is initialised with the values of the this Feature object.- Returns:
- the new builder.
-
getId
java.lang.String getId()
Returns the ID of this Feature.- Returns:
- the ID of this Feature.
-
getDefinition
java.util.Optional<FeatureDefinition> getDefinition()
Returns the attached Definition of this Feature.- Returns:
- the Definition or an empty Optional.
-
setDefinition
Feature setDefinition(FeatureDefinition featureDefinition)
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:
java.lang.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
java.util.Optional<FeatureProperties> getProperties()
Returns the properties of this Feature.- Returns:
- the properties of this Feature.
-
setProperties
Feature setProperties(FeatureProperties properties)
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:
java.lang.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
default java.util.Optional<org.eclipse.ditto.json.JsonValue> getProperty(java.lang.CharSequence pointer)
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:
java.lang.NullPointerException- ifpointerisnull.
-
getProperty
java.util.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.- 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:
java.lang.NullPointerException- ifpointerisnull.
-
setProperty
default Feature setProperty(java.lang.CharSequence 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:
java.lang.NullPointerException- if any argument isnull.
-
setProperty
default Feature setProperty(java.lang.CharSequence pointer, boolean 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:
java.lang.NullPointerException- if any argument isnull.
-
setProperty
default Feature setProperty(java.lang.CharSequence pointer, int 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:
java.lang.NullPointerException- if any argument isnull.
-
setProperty
default Feature setProperty(java.lang.CharSequence pointer, long 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:
java.lang.NullPointerException- if any argument isnull.
-
setProperty
default Feature setProperty(java.lang.CharSequence pointer, double 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:
java.lang.NullPointerException- if any argument isnull.
-
setProperty
default Feature setProperty(java.lang.CharSequence pointer, java.lang.String 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:
java.lang.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:
java.lang.NullPointerException- if any argument isnull.
-
removeProperty
default Feature removeProperty(java.lang.CharSequence pointer)
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:
java.lang.NullPointerException- ifpointerisnull.
-
removeProperty
Feature removeProperty(org.eclipse.ditto.json.JsonPointer pointer)
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:
java.lang.NullPointerException- ifpointerisnull.
-
getDesiredProperties
java.util.Optional<FeatureProperties> getDesiredProperties()
Returns the desired properties of this Feature.- Returns:
- the desired properties of this Feature.
- Since:
- 1.5.0
-
setDesiredProperties
Feature setDesiredProperties(FeatureProperties desiredProperties)
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:
java.lang.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
default java.util.Optional<org.eclipse.ditto.json.JsonValue> getDesiredProperty(java.lang.CharSequence 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:
java.lang.NullPointerException- ifpointerisnull.- Since:
- 1.5.0
-
getDesiredProperty
java.util.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:
java.lang.NullPointerException- ifpointerisnull.- Since:
- 1.5.0
-
setDesiredProperty
default Feature setDesiredProperty(java.lang.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:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
default Feature setDesiredProperty(java.lang.CharSequence pointer, boolean 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:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
default Feature setDesiredProperty(java.lang.CharSequence pointer, int 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:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
default Feature setDesiredProperty(java.lang.CharSequence pointer, long 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 property value to be set.- Returns:
- a copy of this Feature with the given desired property value set.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
default Feature setDesiredProperty(java.lang.CharSequence pointer, double 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:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setDesiredProperty
default Feature setDesiredProperty(java.lang.CharSequence pointer, java.lang.String 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:
java.lang.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:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeDesiredProperty
default Feature removeDesiredProperty(java.lang.CharSequence pointer)
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:
java.lang.NullPointerException- ifpointerisnull.- Since:
- 1.5.0
-
removeDesiredProperty
Feature removeDesiredProperty(org.eclipse.ditto.json.JsonPointer pointer)
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:
java.lang.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
-
-