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 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 Classes
    Modifier and Type
    Interface
    Description
    static final class 
    An enumeration of the known JsonFields 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 Type
    Method
    Description
    Returns the attached Definition of this Feature.
    Returns the desired properties of this Feature.
    default Optional<org.eclipse.ditto.json.JsonValue>
    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.
    Returns the ID of this Feature.
    Returns the properties of this Feature.
    default Optional<org.eclipse.ditto.json.JsonValue>
    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 immutable Feature.
    Removes the Definition from a copy of this Feature.
    Removes all desired properties on a copy of this Feature.
    default Feature
    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 Feature
    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.
    Sets the given desired properties to a copy of this Feature.
    default Feature
    setDesiredProperty(CharSequence pointer, boolean desiredPropertyValue)
    Sets the value of a desired property which is referred by the given JSON Pointer.
    default Feature
    setDesiredProperty(CharSequence pointer, double desiredPropertyValue)
    Sets the value of a desired property which is referred by the given JSON Pointer.
    default Feature
    setDesiredProperty(CharSequence pointer, int desiredPropertyValue)
    Sets the value of a desired property which is referred by the given JSON Pointer.
    default Feature
    setDesiredProperty(CharSequence pointer, long desiredPropertyValue)
    Sets the value of a desired property which is referred by the given JSON Pointer.
    default Feature
    setDesiredProperty(CharSequence pointer, String desiredPropertyValue)
    Sets the value of a desired property which is referred by the given JSON Pointer.
    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.
    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.
    Sets the given properties to a copy of this Feature.
    default Feature
    setProperty(CharSequence pointer, boolean propertyValue)
    Sets the value of a property which is referred by the given JSON Pointer.
    default Feature
    setProperty(CharSequence pointer, double propertyValue)
    Sets the value of a property which is referred by the given JSON Pointer.
    default Feature
    setProperty(CharSequence pointer, int propertyValue)
    Sets the value of a property which is referred by the given JSON Pointer.
    default Feature
    setProperty(CharSequence pointer, long propertyValue)
    Sets the value of a property which is referred by the given JSON Pointer.
    default Feature
    setProperty(CharSequence pointer, String propertyValue)
    Sets the value of a property which is referred by the given JSON Pointer.
    default Feature
    setProperty(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.
    Returns a new builder for an immutable Feature which is initialised with the values of the this Feature object.
    default org.eclipse.ditto.json.JsonObject
    Returns all non-hidden marked fields of this Feature.
    default org.eclipse.ditto.json.JsonObject
    toJson(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

    Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable.WithPointer

    toJsonString, toJsonString

    Methods 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 immutable Feature.
      Returns:
      the builder.
    • toBuilder

      default FeatureBuilder.FromCopyBuildable toBuilder()
      Returns a new builder for an immutable Feature which 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

      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:
      NullPointerException - if featureDefinition is null.
    • 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

      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:
      NullPointerException - if properties is null.
    • 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 Optional<org.eclipse.ditto.json.JsonValue> getProperty(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:
      NullPointerException - if pointer is null.
    • getProperty

      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:
      NullPointerException - if pointer is null.
    • setProperty

      default Feature setProperty(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:
      NullPointerException - if any argument is null.
    • setProperty

      default Feature setProperty(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:
      NullPointerException - if any argument is null.
    • setProperty

      default Feature setProperty(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:
      NullPointerException - if any argument is null.
    • setProperty

      default Feature setProperty(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:
      NullPointerException - if any argument is null.
    • setProperty

      default Feature setProperty(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:
      NullPointerException - if any argument is null.
    • setProperty

      default Feature setProperty(CharSequence pointer, 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:
      NullPointerException - if any argument is null.
    • 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 is null.
    • removeProperty

      default Feature removeProperty(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:
      NullPointerException - if pointer is null.
    • 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:
      NullPointerException - if pointer is null.
    • getDesiredProperties

      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:
      NullPointerException - if desiredProperties is null.
      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 Optional<org.eclipse.ditto.json.JsonValue> getDesiredProperty(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:
      NullPointerException - if pointer is null.
      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 - if pointer is null.
      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 is null.
      Since:
      1.5.0
    • setDesiredProperty

      default Feature setDesiredProperty(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:
      NullPointerException - if any argument is null.
      Since:
      1.5.0
    • setDesiredProperty

      default Feature setDesiredProperty(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:
      NullPointerException - if any argument is null.
      Since:
      1.5.0
    • setDesiredProperty

      default Feature setDesiredProperty(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:
      NullPointerException - if any argument is null.
      Since:
      1.5.0
    • setDesiredProperty

      default Feature setDesiredProperty(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:
      NullPointerException - if any argument is null.
      Since:
      1.5.0
    • setDesiredProperty

      default Feature setDesiredProperty(CharSequence pointer, 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:
      NullPointerException - if any argument is null.
      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 is null.
      Since:
      1.5.0
    • removeDesiredProperty

      default Feature removeDesiredProperty(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:
      NullPointerException - if pointer is null.
      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:
      NullPointerException - if pointer is null.
      Since:
      1.5.0
    • toJson

      default org.eclipse.ditto.json.JsonObject toJson()
      Returns all non-hidden marked fields of this Feature.
      Specified by:
      toJson in interface org.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:
      toJson in interface org.eclipse.ditto.base.model.json.Jsonifiable.WithFieldSelector