Package org.eclipse.ditto.things.model
Interface Thing
-
- All Superinterfaces:
org.eclipse.ditto.base.model.entity.Entity<ThingRevision>,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 Thing extends org.eclipse.ditto.base.model.entity.Entity<ThingRevision>
A generic entity which can be used as a "handle" for multipleFeatures belonging to this Thing. A Thing can be for example:- a physical device like a lawn mower, a sensor, a vehicle or a lamp;
- a virtual device like a room in a house, a virtual power plant spanning multiple power plants, the weather information for a specific location collected by various sensors;
- a transactional entity like a tour of a vehicle (from start until stop) or a series of measurements of a machine;
- a master data entity like a supplier of devices or a service provider for devices or an entity representing a city/region;
- anything else – if it can be modeled and managed appropriately by the supported concepts/capabilities of Ditto.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classThing.JsonFieldsAn enumeration of the knownJsonFields of a Thing.-
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<Attributes>getAttributes()Returns the attributes of this Thing.java.util.Optional<ThingDefinition>getDefinition()Gets the definition of this Thing.java.util.Optional<ThingId>getEntityId()java.util.Optional<Features>getFeatures()Returns the Features of this Thing.default org.eclipse.ditto.base.model.json.JsonSchemaVersiongetImplementedSchemaVersion()java.util.Optional<ThingLifecycle>getLifecycle()Returns the current lifecycle of this Thing.java.util.Optional<java.lang.String>getNamespace()Returns the namespace this Thing was created in.java.util.Optional<org.eclipse.ditto.policies.model.PolicyId>getPolicyEntityId()Returns the Policy ID of this Thing.default booleanhasLifecycle(ThingLifecycle lifecycle)Indicates whether this Thing has the given lifecycle.static ThingBuilder.FromScratchnewBuilder()Returns a mutable builder with a fluent API for an immutableThingfrom scratch.default ThingremoveAttribute(java.lang.CharSequence attributePath)Removes the attribute at the given path from a copy of this Thing.ThingremoveAttribute(org.eclipse.ditto.json.JsonPointer attributePath)Removes the attribute at the given path from a copy of this Thing.ThingremoveAttributes()Removes all attributes from a copy of this Thing.ThingremoveDefinition()Removes the Thing's definition on a copy of this Thing.ThingremoveFeature(java.lang.String featureId)Removes the Feature with the specified ID from a copy of this Thing.ThingremoveFeatureDefinition(java.lang.String featureId)Removes the definition from the Feature of this thing with the specified feature ID.ThingremoveFeatureDesiredProperties(java.lang.CharSequence featureId)Removes all desired properties from the given Feature on a copy of this Thing.default ThingremoveFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence propertyPath)Removes the given desired property from a Feature on a copy of this Thing.ThingremoveFeatureDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer propertyPath)Removes the given desired property from a Feature on a copy of this Thing.ThingremoveFeatureProperties(java.lang.String featureId)Removes all properties from the given Feature on a copy of this Thing.default ThingremoveFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath)Removes the given property from a Feature on a copy of this Thing.ThingremoveFeatureProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)Removes the given property from a Feature on a copy of this Thing.ThingremoveFeatures()Removes all Features from a copy of this Thing.default ThingsetAttribute(java.lang.CharSequence attributePath, boolean attributeValue)Sets the given attribute on a copy of this Thing.default ThingsetAttribute(java.lang.CharSequence attributePath, double attributeValue)Sets the given attribute on a copy of this Thing.default ThingsetAttribute(java.lang.CharSequence attributePath, int attributeValue)Sets the given attribute on a copy of this Thing.default ThingsetAttribute(java.lang.CharSequence attributePath, long attributeValue)Sets the given attribute on a copy of this Thing.default ThingsetAttribute(java.lang.CharSequence attributePath, java.lang.String attributeValue)Sets the given attribute on a copy of this Thing.default ThingsetAttribute(java.lang.CharSequence attributePath, org.eclipse.ditto.json.JsonValue attributeValue)Sets the given attribute on a copy of this Thing.ThingsetAttribute(org.eclipse.ditto.json.JsonPointer attributePath, org.eclipse.ditto.json.JsonValue attributeValue)Sets the given attribute on a copy of this Thing.ThingsetAttributes(Attributes attributes)Sets the attributes on a copy of this Thing.ThingsetDefinition(java.lang.CharSequence definitionIdentifier)Sets the definition on a copy of this Thing.ThingsetFeature(Feature feature)Sets the given Feature to a copy of this Thing.ThingsetFeatureDefinition(java.lang.String featureId, FeatureDefinition definition)Sets the given definition of a Feature on a copy of this Thing.ThingsetFeatureDesiredProperties(java.lang.CharSequence featureId, FeatureProperties desiredProperties)Sets the given desired properties of a Feature on a copy of this Thing.default ThingsetFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, boolean desiredPropertyValue)Sets the given desired property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, double desiredPropertyValue)Sets the given desired property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, int desiredPropertyValue)Sets the given desired property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, long desiredPropertyValue)Sets the given desired property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, java.lang.String desiredPropertyValue)Sets the given desired property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, org.eclipse.ditto.json.JsonValue desiredPropertyValue)Sets the given desired property to the Feature with the given ID on a copy of this Thing.ThingsetFeatureDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath, org.eclipse.ditto.json.JsonValue desiredPropertyValue)Sets the given desired property to the Feature with the given ID on a copy of this Thing.ThingsetFeatureProperties(java.lang.String featureId, FeatureProperties properties)Sets the given properties of a Feature on a copy of this Thing.default ThingsetFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, boolean propertyValue)Sets the given property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, double propertyValue)Sets the given property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, int propertyValue)Sets the given property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, long propertyValue)Sets the given property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, java.lang.String propertyValue)Sets the given property to the Feature with the given ID on a copy of this Thing.default ThingsetFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, org.eclipse.ditto.json.JsonValue propertyValue)Sets the given property to the Feature with the given ID on a copy of this Thing.ThingsetFeatureProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath, org.eclipse.ditto.json.JsonValue propertyValue)Sets the given property to the Feature with the given ID on a copy of this Thing.ThingsetFeatures(Features features)Sets the given Features to a copy of this Thing.ThingsetLifecycle(ThingLifecycle newLifecycle)Sets the given lifecycle to a copy of this Thing.ThingsetPolicyId(org.eclipse.ditto.policies.model.PolicyId policyId)Sets the given Policy ID on a copy of this Thing.default ThingBuilder.FromCopytoBuilder()Returns a mutable builder with a fluent API for immutableThing.-
Methods inherited from interface org.eclipse.ditto.base.model.entity.Entity
getCreated, getMetadata, getModified, getRevision, isDeleted, toJson, toJson
-
Methods inherited from interface org.eclipse.ditto.base.model.json.Jsonifiable
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 ThingBuilder.FromScratch newBuilder()
Returns a mutable builder with a fluent API for an immutableThingfrom scratch.- Returns:
- the new builder.
-
toBuilder
default ThingBuilder.FromCopy toBuilder()
Returns a mutable builder with a fluent API for immutableThing. The builder is initialised with the entries of this instance.- Returns:
- the new builder.
-
getImplementedSchemaVersion
default org.eclipse.ditto.base.model.json.JsonSchemaVersion getImplementedSchemaVersion()
- Specified by:
getImplementedSchemaVersionin interfaceorg.eclipse.ditto.base.model.json.Jsonifiable<org.eclipse.ditto.json.JsonObject>
-
getNamespace
java.util.Optional<java.lang.String> getNamespace()
Returns the namespace this Thing was created in. The namespace is derived from the ID of this Thing.- Returns:
- the namespace this Thing was created in.
-
getAttributes
java.util.Optional<Attributes> getAttributes()
Returns the attributes of this Thing.- Returns:
- the attributes of this Thing.
-
setAttributes
Thing setAttributes(@Nullable Attributes attributes)
Sets the attributes on a copy of this Thing.- Parameters:
attributes- the attributes.- Returns:
- a copy of this Thing with the given attributes.
-
removeAttributes
Thing removeAttributes()
Removes all attributes from a copy of this Thing.- Returns:
- a copy of this Thing with all of its attributes removed.
-
getEntityId
java.util.Optional<ThingId> getEntityId()
- Specified by:
getEntityIdin interfaceorg.eclipse.ditto.base.model.entity.Entity<ThingRevision>
-
setAttribute
default Thing setAttribute(java.lang.CharSequence attributePath, org.eclipse.ditto.json.JsonValue attributeValue)
Sets the given attribute on a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the attribute value to be set.- Returns:
- a copy of this Thing with the given attribute.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
setAttribute
default Thing setAttribute(java.lang.CharSequence attributePath, boolean attributeValue)
Sets the given attribute on a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the attribute value to be set.- Returns:
- a copy of this Thing with the given attribute.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
setAttribute
default Thing setAttribute(java.lang.CharSequence attributePath, int attributeValue)
Sets the given attribute on a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the attribute value to be set.- Returns:
- a copy of this Thing with the given attribute.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
setAttribute
default Thing setAttribute(java.lang.CharSequence attributePath, long attributeValue)
Sets the given attribute on a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the attribute value to be set.- Returns:
- a copy of this Thing with the given attribute.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
setAttribute
default Thing setAttribute(java.lang.CharSequence attributePath, double attributeValue)
Sets the given attribute on a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the attribute value to be set.- Returns:
- a copy of this Thing with the given attribute.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
setAttribute
default Thing setAttribute(java.lang.CharSequence attributePath, java.lang.String attributeValue)
Sets the given attribute on a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the attribute value to be set.- Returns:
- a copy of this Thing with the given attribute.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
setAttribute
Thing setAttribute(org.eclipse.ditto.json.JsonPointer attributePath, org.eclipse.ditto.json.JsonValue attributeValue)
Sets the given attribute on a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the attribute value to be set.- Returns:
- a copy of this Thing with the given attribute.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
removeAttribute
default Thing removeAttribute(java.lang.CharSequence attributePath)
Removes the attribute at the given path from a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute to be removed.- Returns:
- a copy of this Thing without the removed attribute.
- Throws:
java.lang.NullPointerException- ifpointerisnull.java.lang.IllegalArgumentException- ifpointeris empty.
-
removeAttribute
Thing removeAttribute(org.eclipse.ditto.json.JsonPointer attributePath)
Removes the attribute at the given path from a copy of this Thing.- Parameters:
attributePath- the hierarchical path to the attribute to be removed.- Returns:
- a copy of this Thing without the removed attribute.
- Throws:
java.lang.NullPointerException- ifpointerisnull.java.lang.IllegalArgumentException- ifpointeris empty.
-
getDefinition
java.util.Optional<ThingDefinition> getDefinition()
Gets the definition of this Thing.- Returns:
- the Definition of this Thing.
-
setDefinition
Thing setDefinition(@Nullable java.lang.CharSequence definitionIdentifier)
Sets the definition on a copy of this Thing.- Parameters:
definitionIdentifier- the Thing's definition to set.- Returns:
- a copy of this Thing with the given definition.
- Throws:
DefinitionIdentifierInvalidException- ifdefinitionIdentifieris invalid.
-
removeDefinition
Thing removeDefinition()
Removes the Thing's definition on a copy of this Thing.- Returns:
- a copy of this Thing without definition.
-
setFeatureDefinition
Thing setFeatureDefinition(java.lang.String featureId, FeatureDefinition definition)
Sets the given definition of a Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.definition- the definition to be set.- Returns:
- a copy of this Thing with the Feature containing the given definition.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
removeFeatureDefinition
Thing removeFeatureDefinition(java.lang.String featureId)
Removes the definition from the Feature of this thing with the specified feature ID.- Parameters:
featureId- the identifier of the Feature to delete the definition from.- Returns:
- a copy of this Thing with the Feature without definition.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setFeatureProperties
Thing setFeatureProperties(java.lang.String featureId, FeatureProperties properties)
Sets the given properties of a Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.properties- the properties to be set.- Returns:
- a copy of this Thing with the Feature containing the given properties.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setFeatureProperty
default Thing setFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, org.eclipse.ditto.json.JsonValue propertyValue)
Sets the given property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Thing with the Feature containing the given property.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperty
default Thing setFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, boolean propertyValue)
Sets the given property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Thing with the Feature containing the given property.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperty
default Thing setFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, int propertyValue)
Sets the given property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Thing with the Feature containing the given property.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperty
default Thing setFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, long propertyValue)
Sets the given property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Thing with the Feature containing the given property.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperty
default Thing setFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, double propertyValue)
Sets the given property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Thing with the Feature containing the given property.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperty
default Thing setFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath, java.lang.String propertyValue)
Sets the given property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Thing with the Feature containing the given property.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperty
Thing setFeatureProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath, org.eclipse.ditto.json.JsonValue propertyValue)
Sets the given property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be set.propertyValue- the property value to be set.- Returns:
- a copy of this Thing with the Feature containing the given property.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeFeatureProperties
Thing removeFeatureProperties(java.lang.String featureId)
Removes all properties from the given Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature of which all properties are to be removed.- Returns:
- a copy of this Thing with all of the Feature's properties removed.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
removeFeatureProperty
default Thing removeFeatureProperty(java.lang.String featureId, java.lang.CharSequence propertyPath)
Removes the given property from a Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be removed.- Returns:
- a copy of this Thing with the given Feature property removed.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeFeatureProperty
Thing removeFeatureProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)
Removes the given property from a Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the property to be removed.- Returns:
- a copy of this Thing with the given Feature property removed.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureDesiredProperties
Thing setFeatureDesiredProperties(java.lang.CharSequence featureId, FeatureProperties desiredProperties)
Sets the given desired properties of a Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredProperties- the desired properties to be set.- Returns:
- a copy of this Thing with the Feature containing the given desired properties.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
default Thing setFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, org.eclipse.ditto.json.JsonValue desiredPropertyValue)
Sets the given desired property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- 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 Thing with the Feature containing the given desired property.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
default Thing setFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, boolean desiredPropertyValue)
Sets the given desired property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- 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 Thing with the Feature containing the given desired property.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
default Thing setFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, int desiredPropertyValue)
Sets the given desired property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- 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 Thing with the Feature containing the given desired property.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
default Thing setFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, long desiredPropertyValue)
Sets the given desired property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- 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 Thing with the Feature containing the given desired property.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
default Thing setFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, double desiredPropertyValue)
Sets the given desired property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- 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 Thing with the Feature containing the given desired property.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
default Thing setFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence desiredPropertyPath, java.lang.String desiredPropertyValue)
Sets the given desired property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- 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 Thing with the Feature containing the given desired property.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
Thing setFeatureDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath, org.eclipse.ditto.json.JsonValue desiredPropertyValue)
Sets the given desired property to the Feature with the given ID on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- 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 Thing with the Feature containing the given desired property.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeFeatureDesiredProperties
Thing removeFeatureDesiredProperties(java.lang.CharSequence featureId)
Removes all desired properties from the given Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature of which all desired properties are to be removed.- Returns:
- a copy of this Thing with all of the Feature's desired properties removed.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.- Since:
- 1.5.0
-
removeFeatureDesiredProperty
default Thing removeFeatureDesiredProperty(java.lang.CharSequence featureId, java.lang.CharSequence propertyPath)
Removes the given desired property from a Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the desired property to be removed.- Returns:
- a copy of this Thing with the given Features desired property removed.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeFeatureDesiredProperty
Thing removeFeatureDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer propertyPath)
Removes the given desired property from a Feature on a copy of this Thing.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path within the Feature to the desired property to be removed.- Returns:
- a copy of this Thing with the given Feature desired property removed.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
getLifecycle
java.util.Optional<ThingLifecycle> getLifecycle()
Returns the current lifecycle of this Thing.- Returns:
- the current lifecycle of this Thing.
-
setLifecycle
Thing setLifecycle(ThingLifecycle newLifecycle)
Sets the given lifecycle to a copy of this Thing.- Parameters:
newLifecycle- the lifecycle to set.- Returns:
- a copy of this Thing with the lifecycle set to
newLifecycle. - Throws:
java.lang.NullPointerException- ifnewLifecycleisnull.
-
hasLifecycle
default boolean hasLifecycle(ThingLifecycle lifecycle)
Indicates whether this Thing has the given lifecycle.- Parameters:
lifecycle- the lifecycle to be checked for.- Returns:
trueif this Thing haslifecycleas its lifecycle,falseelse.
-
setPolicyId
Thing setPolicyId(@Nullable org.eclipse.ditto.policies.model.PolicyId policyId)
Sets the given Policy ID on a copy of this Thing.- Parameters:
policyId- the Policy ID to set.- Returns:
- a copy of this Thing with
policyIdas its Policy ID.
-
getPolicyEntityId
java.util.Optional<org.eclipse.ditto.policies.model.PolicyId> getPolicyEntityId()
Returns the Policy ID of this Thing.- Returns:
- the Policy ID of this Thing.
-
getFeatures
java.util.Optional<Features> getFeatures()
Returns the Features of this Thing.- Returns:
- the Features of this Thing.
-
setFeatures
Thing setFeatures(@Nullable Features features)
Sets the given Features to a copy of this Thing.- Parameters:
features- the Features to be set.- Returns:
- a copy of this Thing with the features set.
-
removeFeatures
Thing removeFeatures()
Removes all Features from a copy of this Thing.- Returns:
- a copy of this Thing with all of its Features removed.
-
setFeature
Thing setFeature(Feature feature)
Sets the given Feature to a copy of this Thing. An already existing Feature with the same ID is replaced.- Parameters:
feature- the Feature to be set.- Returns:
- a copy of this Thing with the given feature.
- Throws:
java.lang.NullPointerException- iffeatureisnull.
-
removeFeature
Thing removeFeature(java.lang.String featureId)
Removes the Feature with the specified ID from a copy of this Thing.- Parameters:
featureId- the ID of the Feature to be removed.- Returns:
- a copy of this Thing without the Feature with the given ID.
-
-