Package org.eclipse.ditto.things.model
Interface ThingBuilder.FromCopy
-
- Enclosing interface:
- ThingBuilder
@NotThreadSafe public static interface ThingBuilder.FromCopyA mutable builder with a fluent API for an immutableThing. This builder is initialised with the properties of an existing Thing.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Thingbuild()Creates a new Thing object based on the data which was provided to this builder.default ThingBuilder.FromCopyremoveAllAttributes()Removes all attributes from this builder.ThingBuilder.FromCopyremoveAllAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate)Removes all attributes from this builder.default ThingBuilder.FromCopyremoveAllFeatures()Removes all features from this builder.ThingBuilder.FromCopyremoveAllFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate)Removes all features from this builder.ThingBuilder.FromCopyremoveAttribute(java.util.function.Predicate<Attributes> existingAttributesPredicate, org.eclipse.ditto.json.JsonPointer attributePath)Removes the attribute at the given path from this builder.default ThingBuilder.FromCopyremoveAttribute(org.eclipse.ditto.json.JsonPointer attributePath)Removes the attribute at the given path from this builder.ThingBuilder.FromCopyremoveDefinition()Removes the ThingDefinition from this builder.default ThingBuilder.FromCopyremoveFeature(java.lang.String featureId)Removes the Feature with the given ID from this builder.ThingBuilder.FromCopyremoveFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId)Removes the Feature with the given ID from this builder.ThingBuilder.FromCopyremoveFeatureDefinition(java.lang.String featureId)Removes the definition from Feature with the given identifier on this builder.default ThingBuilder.FromCopyremoveFeatureDesiredProperties(java.lang.CharSequence featureId)Removes all desired properties from the Feature with the given ID on this builder.ThingBuilder.FromCopyremoveFeatureDesiredProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId)Removes all desired properties from the Feature with the given ID on this builder.default ThingBuilder.FromCopyremoveFeatureDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath)Removes the given desired property from the Feature with the given ID on this builder.ThingBuilder.FromCopyremoveFeatureDesiredProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath)Removes the given desired property from the Feature with the given ID on this builder.default ThingBuilder.FromCopyremoveFeatureProperties(java.lang.String featureId)Removes all properties from the Feature with the given ID on this builder.ThingBuilder.FromCopyremoveFeatureProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId)Removes all properties from the Feature with the given ID on this builder.default ThingBuilder.FromCopyremoveFeatureProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)Removes the given property from the Feature with the given ID on this builder.ThingBuilder.FromCopyremoveFeatureProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)Removes the given property from the Feature with the given ID on this builder.ThingBuilder.FromCopyremovePolicyId()Removes the Policy ID from this builder.ThingBuilder.FromCopysetAttribute(java.util.function.Predicate<Attributes> existingAttributesPredicate, org.eclipse.ditto.json.JsonPointer attributePath, org.eclipse.ditto.json.JsonValue attributeValue)Sets the given attribute to this builder.default ThingBuilder.FromCopysetAttribute(org.eclipse.ditto.json.JsonPointer attributePath, org.eclipse.ditto.json.JsonValue attributeValue)Sets the given attribute to this builder.default ThingBuilder.FromCopysetAttributes(java.lang.String attributesJsonString)Sets the attributes to this builder.ThingBuilder.FromCopysetAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate, java.lang.String attributesJsonString)Sets the attributes to this builder.ThingBuilder.FromCopysetAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate, org.eclipse.ditto.json.JsonObject attributesJsonObject)Sets the attributes to this builder.ThingBuilder.FromCopysetAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate, Attributes attributes)Sets the given attributes to this builder.default ThingBuilder.FromCopysetAttributes(org.eclipse.ditto.json.JsonObject attributesJsonObject)Sets the attributes to this builder.default ThingBuilder.FromCopysetAttributes(Attributes attributes)Sets the given attributes to this builder.default ThingBuilder.FromCopysetCreated(java.time.Instant created)Sets the given created timestamp to this builder.ThingBuilder.FromCopysetCreated(java.util.function.Predicate<java.time.Instant> existingCreatedPredicate, java.time.Instant created)Sets the given created timestamp to this builder.ThingBuilder.FromCopysetDefinition(ThingDefinition definition)Sets the given definition to this builder.default ThingBuilder.FromCopysetFeature(java.lang.CharSequence featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties, FeatureProperties featureDesiredProperties)Sets a Feature with the given ID and properties to this builder.default ThingBuilder.FromCopysetFeature(java.lang.String featureId)Sets a Feature with the given ID to this builder.default ThingBuilder.FromCopysetFeature(java.lang.String featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties)Sets a Feature with the given ID and properties to this builder.default ThingBuilder.FromCopysetFeature(java.lang.String featureId, FeatureProperties featureProperties)Sets a Feature with the given ID and properties to this builder.ThingBuilder.FromCopysetFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties, FeatureProperties featureDesiredProperties)Sets a Feature with the given ID and properties to this builder.ThingBuilder.FromCopysetFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId)Sets a Feature with the given ID to this builder.ThingBuilder.FromCopysetFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties)Sets a Feature with the given ID and properties to this builder.ThingBuilder.FromCopysetFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureProperties featureProperties)Sets a Feature with the given ID and properties to this builder.ThingBuilder.FromCopysetFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, Feature feature)Sets the given Feature to this builder.default ThingBuilder.FromCopysetFeature(Feature feature)Sets the given Feature to this builder.default ThingBuilder.FromCopysetFeatureDefinition(java.lang.String featureId, FeatureDefinition featureDefinition)Sets the given definition to the Feature with the given ID on this builder.ThingBuilder.FromCopysetFeatureDefinition(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureDefinition featureDefinition)Sets the given definition to the Feature with the given ID on this builder.default ThingBuilder.FromCopysetFeatureDesiredProperties(java.lang.CharSequence featureId, FeatureProperties desiredFeatureProperties)Sets the given desired properties to the Feature with the given ID on this builder.ThingBuilder.FromCopysetFeatureDesiredProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId, FeatureProperties desiredFeatureProperties)Sets the given desired properties to the Feature with the given ID on this builder.default ThingBuilder.FromCopysetFeatureDesiredProperty(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 this builder.ThingBuilder.FromCopysetFeatureDesiredProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, 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 this builder.default ThingBuilder.FromCopysetFeatureProperties(java.lang.String featureId, FeatureProperties featureProperties)Sets the given properties to the Feature with the given ID on this builder.ThingBuilder.FromCopysetFeatureProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureProperties featureProperties)Sets the given properties to the Feature with the given ID on this builder.default ThingBuilder.FromCopysetFeatureProperty(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 this builder.ThingBuilder.FromCopysetFeatureProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, 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 this builder.default ThingBuilder.FromCopysetFeatures(java.lang.Iterable<Feature> features)Sets the given Features to this builder.default ThingBuilder.FromCopysetFeatures(java.lang.String featuresJsonString)Sets the Features of the Thing based on the given JSON object.ThingBuilder.FromCopysetFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.Iterable<Feature> features)Sets the given Features to this builder.ThingBuilder.FromCopysetFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featuresJsonString)Sets the Features of the Thing based on the given JSON object.ThingBuilder.FromCopysetFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate, org.eclipse.ditto.json.JsonObject featuresJsonObject)Sets the features to this builder.default ThingBuilder.FromCopysetFeatures(org.eclipse.ditto.json.JsonObject featuresJsonObject)Sets the features to this builder.default ThingBuilder.FromCopysetGeneratedId()Sets a generated Thing ID to this builder.ThingBuilder.FromCopysetGeneratedId(java.util.function.Predicate<ThingId> existingIdPredicate)Sets a generated Thing ID to this builder.ThingBuilder.FromCopysetId(java.util.function.Predicate<ThingId> existingIdPredicate, ThingId thingId)Sets the given Thing ID to this builder.default ThingBuilder.FromCopysetId(ThingId thingId)Sets the given Thing ID to this builder.ThingBuilder.FromCopysetLifecycle(java.util.function.Predicate<ThingLifecycle> existingLifecyclePredicate, ThingLifecycle lifecycle)Sets the given lifecycle to this builder.default ThingBuilder.FromCopysetLifecycle(ThingLifecycle lifecycle)Sets the given lifecycle to this builder.ThingBuilder.FromCopysetMetadata(java.util.function.Predicate<org.eclipse.ditto.base.model.entity.metadata.Metadata> existingMetadataPredicate, org.eclipse.ditto.base.model.entity.metadata.Metadata metadata)Sets the given metadata to this builder.default ThingBuilder.FromCopysetMetadata(org.eclipse.ditto.base.model.entity.metadata.Metadata metadata)Sets the given metadata to this builder.default ThingBuilder.FromCopysetModified(java.time.Instant modified)Sets the given modified to this builder.ThingBuilder.FromCopysetModified(java.util.function.Predicate<java.time.Instant> existingModifiedPredicate, java.time.Instant modified)Sets the given modified timestamp to this builder.ThingBuilder.FromCopysetNullAttributes()Sets attributes to this builder which represent semanticallynull.ThingBuilder.FromCopysetNullDefinition()Sets the ThingDefinition to this builder which represent semanticallynull.ThingBuilder.FromCopysetNullFeatures()Sets features to this builder which represents semanticallynull.ThingBuilder.FromCopysetPolicyId(org.eclipse.ditto.policies.model.PolicyId policyId)Sets the given Policy ID to this builder.default ThingBuilder.FromCopysetRevision(long revisionNumber)Sets the given revision number to this builder.ThingBuilder.FromCopysetRevision(java.util.function.Predicate<ThingRevision> existingRevisionPredicate, long revisionNumber)Sets the given revision number to this builder.ThingBuilder.FromCopysetRevision(java.util.function.Predicate<ThingRevision> existingRevisionPredicate, ThingRevision revision)Sets the given revision to this builder.default ThingBuilder.FromCopysetRevision(ThingRevision revision)Sets the given revision to this builder.
-
-
-
Method Detail
-
setPolicyId
ThingBuilder.FromCopy setPolicyId(@Nullable org.eclipse.ditto.policies.model.PolicyId policyId)
Sets the given Policy ID to this builder.- Parameters:
policyId- the Policy ID to set.- Returns:
- this builder to allow method chaining.
-
removePolicyId
ThingBuilder.FromCopy removePolicyId()
Removes the Policy ID from this builder.- Returns:
- this builder to allow method chaining.
-
setAttributes
default ThingBuilder.FromCopy setAttributes(Attributes attributes)
Sets the given attributes to this builder.- Parameters:
attributes- the attributes to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifattributesisnull.
-
setAttributes
ThingBuilder.FromCopy setAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate, Attributes attributes)
Sets the given attributes to this builder.- Parameters:
existingAttributesPredicate- a predicate to decide whether the given attributes are set. The predicate receives the currently set attributes.attributes- the attributes to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setAttributes
default ThingBuilder.FromCopy setAttributes(org.eclipse.ditto.json.JsonObject attributesJsonObject)
Sets the attributes to this builder. The attributes are parsed from the given JSON object representation ofAttributes.- Parameters:
attributesJsonObject- the JSON object representation of the attributes to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifattributesJsonObjectisnull.
-
setAttributes
ThingBuilder.FromCopy setAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate, org.eclipse.ditto.json.JsonObject attributesJsonObject)
Sets the attributes to this builder. The attributes are parsed from the given JSON object representation ofAttributes.- Parameters:
existingAttributesPredicate- a predicate to decide whether the given attributes are set. The predicate receives the currently set attributes.attributesJsonObject- the JSON object representation of the attributes to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setAttributes
default ThingBuilder.FromCopy setAttributes(java.lang.String attributesJsonString)
Sets the attributes to this builder. The attributes are parsed from the given JSON string representation ofAttributes.- Parameters:
attributesJsonString- JSON string representation of the attributes to be set.- Returns:
- this builder to allow method chaining.
- Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifattributesJsonStringis not a valid JSON object.
-
setAttributes
ThingBuilder.FromCopy setAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate, java.lang.String attributesJsonString)
Sets the attributes to this builder. The attributes are parsed from the given JSON string representation ofAttributes.- Parameters:
existingAttributesPredicate- a predicate to decide whether the given attributes are set. The predicate receives the currently set attributes.attributesJsonString- JSON string representation of the attributes to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingAttributesPredicateisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifattributesJsonStringis not a valid JSON object.
-
removeAllAttributes
default ThingBuilder.FromCopy removeAllAttributes()
Removes all attributes from this builder.- Returns:
- this builder to allow method chaining.
-
removeAllAttributes
ThingBuilder.FromCopy removeAllAttributes(java.util.function.Predicate<Attributes> existingAttributesPredicate)
Removes all attributes from this builder.- Parameters:
existingAttributesPredicate- a predicate to decide whether the given attributes are set. The predicate receives the currently set attributes.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingAttributesPredicateisnull.
-
setNullAttributes
ThingBuilder.FromCopy setNullAttributes()
Sets attributes to this builder which represent semanticallynull. All already set attributes are discarded.- Returns:
- this builder to allow method chaining.
-
setAttribute
default ThingBuilder.FromCopy setAttribute(org.eclipse.ditto.json.JsonPointer attributePath, org.eclipse.ditto.json.JsonValue attributeValue)
Sets the given attribute to this builder.- Parameters:
attributePath- the hierarchical path to the attribute value.attributeValue- the value to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
setAttribute
ThingBuilder.FromCopy setAttribute(java.util.function.Predicate<Attributes> existingAttributesPredicate, org.eclipse.ditto.json.JsonPointer attributePath, org.eclipse.ditto.json.JsonValue attributeValue)
Sets the given attribute to this builder.- Parameters:
existingAttributesPredicate- a predicate to decide whether the given attributes are set. The predicate receives the currently set attributes.attributePath- the hierarchical path to the attribute value.attributeValue- the value to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- ifattributePathis empty.
-
removeAttribute
default ThingBuilder.FromCopy removeAttribute(org.eclipse.ditto.json.JsonPointer attributePath)
Removes the attribute at the given path from this builder.- Parameters:
attributePath- the hierarchical path to the attribute to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifattributePathisnull.
-
removeAttribute
ThingBuilder.FromCopy removeAttribute(java.util.function.Predicate<Attributes> existingAttributesPredicate, org.eclipse.ditto.json.JsonPointer attributePath)
Removes the attribute at the given path from this builder.- Parameters:
existingAttributesPredicate- a predicate to decide whether the given attributes are set. The predicate receives the currently set attributes.attributePath- the hierarchical path to the attribute to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setDefinition
ThingBuilder.FromCopy setDefinition(@Nullable ThingDefinition definition)
Sets the given definition to this builder.- Parameters:
definition- the Definition to set.- Returns:
- this builder to allow method chaining.
-
setNullDefinition
ThingBuilder.FromCopy setNullDefinition()
Sets the ThingDefinition to this builder which represent semanticallynull. An already set definition is discarded.- Returns:
- this builder to allow method chaining.
-
removeDefinition
ThingBuilder.FromCopy removeDefinition()
Removes the ThingDefinition from this builder.- Returns:
- this builder to allow method chaining.
-
setFeature
default ThingBuilder.FromCopy setFeature(Feature feature)
Sets the given Feature to this builder. A previously set Feature with the same ID is replaced.- Parameters:
feature- the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureisnull.
-
setFeature
ThingBuilder.FromCopy setFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, Feature feature)
Sets the given Feature to this builder. A previously set Feature with the same ID is replaced.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided Feature is set to the builder.feature- the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeature
default ThingBuilder.FromCopy setFeature(java.lang.String featureId)
Sets a Feature with the given ID to this builder. A previously set Feature with the same ID is replaced.- Parameters:
featureId- the ID of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setFeature
ThingBuilder.FromCopy setFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId)
Sets a Feature with the given ID to this builder. A previously set Feature with the same ID is replaced.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided Feature is set to the builder.featureId- the ID of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeFeature
default ThingBuilder.FromCopy removeFeature(java.lang.String featureId)
Removes the Feature with the given ID from this builder.- Parameters:
featureId- the ID of the Feature to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
removeFeature
ThingBuilder.FromCopy removeFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId)
Removes the Feature with the given ID from this builder.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.featureId- the ID of the Feature to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeature
default ThingBuilder.FromCopy setFeature(java.lang.String featureId, FeatureProperties featureProperties)
Sets a Feature with the given ID and properties to this builder. A previously set Feature with the same ID is replaced.- Parameters:
featureId- the ID of the Feature to be set.featureProperties- the properties of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setFeature
ThingBuilder.FromCopy setFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureProperties featureProperties)
Sets a Feature with the given ID and properties to this builder. A previously set Feature with the same ID is replaced.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided Feature is set to the builder.featureId- the ID of the Feature to be set.featureProperties- the properties of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeature
default ThingBuilder.FromCopy setFeature(java.lang.String featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties)
Sets a Feature with the given ID and properties to this builder. A previously set Feature with the same ID is replaced.- Parameters:
featureId- the ID of the Feature to be set.featureDefinition- the definition of the Feature to be set.featureProperties- the properties of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setFeature
default ThingBuilder.FromCopy setFeature(java.lang.CharSequence featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties, FeatureProperties featureDesiredProperties)
Sets a Feature with the given ID and properties to this builder. A previously set Feature with the same ID is replaced.- Parameters:
featureId- the ID of the Feature to be set.featureDefinition- the definition of the Feature to be set.featureProperties- the properties of the Feature to be set.featureDesiredProperties- the desired properties of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.- Since:
- 1.5.0
-
setFeature
ThingBuilder.FromCopy setFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties)
Sets a Feature with the given ID and properties to this builder. A previously set Feature with the same ID is replaced.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.featureId- the ID of the Feature to be set.featureDefinition- the definition of the Feature to be set.featureProperties- the properties of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeature
ThingBuilder.FromCopy setFeature(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties, FeatureProperties featureDesiredProperties)
Sets a Feature with the given ID and properties to this builder. A previously set Feature with the same ID is replaced.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided Feature is set to the builder.featureId- the ID of the Feature to be set.featureDefinition- the definition of the Feature to be set.featureProperties- the properties of the Feature to be set.featureDesiredProperties- the desired properties of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDefinition
default ThingBuilder.FromCopy setFeatureDefinition(java.lang.String featureId, FeatureDefinition featureDefinition)
Sets the given definition to the Feature with the given ID on this builder.- Parameters:
featureId- the ID of the Feature to be set.featureDefinition- the definition of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureDefinition
ThingBuilder.FromCopy setFeatureDefinition(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureDefinition featureDefinition)
Sets the given definition to the Feature with the given ID on this builder.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given definition is set. The predicate receives the currently set features.featureId- the ID of the Feature to be set.featureDefinition- the definition of the Feature to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeFeatureDefinition
ThingBuilder.FromCopy removeFeatureDefinition(java.lang.String featureId)
Removes the definition from Feature with the given identifier on this builder.- Parameters:
featureId- the ID of the Feature from which the definition is to be deleted.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
setFeatureProperty
default ThingBuilder.FromCopy 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 this builder.- 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:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperty
ThingBuilder.FromCopy setFeatureProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, 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 this builder.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.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:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeFeatureProperty
default ThingBuilder.FromCopy removeFeatureProperty(java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)
Removes the given property from the Feature with the given ID on this builder.- Parameters:
featureId- the ID of the Feature.propertyPath- the hierarchical path to within the Feature to the property to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeFeatureProperty
ThingBuilder.FromCopy removeFeatureProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, org.eclipse.ditto.json.JsonPointer propertyPath)
Removes the given property from the Feature with the given ID on this builder.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided feature property is removed from the builder.featureId- the ID of the Feature.propertyPath- the hierarchical path to within the Feature to the property to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperties
default ThingBuilder.FromCopy setFeatureProperties(java.lang.String featureId, FeatureProperties featureProperties)
Sets the given properties to the Feature with the given ID on this builder.- Parameters:
featureId- the ID of the Feature.featureProperties- the properties to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureProperties
ThingBuilder.FromCopy setFeatureProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId, FeatureProperties featureProperties)
Sets the given properties to the Feature with the given ID on this builder.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.featureId- the ID of the Feature.featureProperties- the properties to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeFeatureProperties
default ThingBuilder.FromCopy removeFeatureProperties(java.lang.String featureId)
Removes all properties from the Feature with the given ID on this builder.- Parameters:
featureId- the ID of the Feature.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.
-
removeFeatureProperties
ThingBuilder.FromCopy removeFeatureProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featureId)
Removes all properties from the Feature with the given ID on this builder.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided feature properties are removed from the builder.featureId- the ID of the Feature.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
setFeatureDesiredProperty
default ThingBuilder.FromCopy 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 this builder.- 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:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperty
ThingBuilder.FromCopy setFeatureDesiredProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, 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 this builder.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.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:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeFeatureDesiredProperty
default ThingBuilder.FromCopy removeFeatureDesiredProperty(java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath)
Removes the given desired property from the Feature with the given ID on this builder.- Parameters:
featureId- the ID of the Feature.desiredPropertyPath- the hierarchical path to within the Feature to the desired property to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeFeatureDesiredProperty
ThingBuilder.FromCopy removeFeatureDesiredProperty(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId, org.eclipse.ditto.json.JsonPointer desiredPropertyPath)
Removes the given desired property from the Feature with the given ID on this builder.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided desired feature property is removed from the builder.featureId- the ID of the Feature.desiredPropertyPath- the hierarchical path to within the Feature to the desired property to be removed.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperties
default ThingBuilder.FromCopy setFeatureDesiredProperties(java.lang.CharSequence featureId, FeatureProperties desiredFeatureProperties)
Sets the given desired properties to the Feature with the given ID on this builder.- Parameters:
featureId- the ID of the Feature.desiredFeatureProperties- the desired properties to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatureDesiredProperties
ThingBuilder.FromCopy setFeatureDesiredProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId, FeatureProperties desiredFeatureProperties)
Sets the given desired properties to the Feature with the given ID on this builder.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.featureId- the ID of the Feature.desiredFeatureProperties- the desired properties to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
removeFeatureDesiredProperties
default ThingBuilder.FromCopy removeFeatureDesiredProperties(java.lang.CharSequence featureId)
Removes all desired properties from the Feature with the given ID on this builder.- Parameters:
featureId- the ID of the Feature.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeatureIdisnull.- Since:
- 1.5.0
-
removeFeatureDesiredProperties
ThingBuilder.FromCopy removeFeatureDesiredProperties(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.CharSequence featureId)
Removes all desired properties from the Feature with the given ID on this builder.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided desired feature properties are removed from the builder.featureId- the ID of the Feature.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.- Since:
- 1.5.0
-
setFeatures
default ThingBuilder.FromCopy setFeatures(org.eclipse.ditto.json.JsonObject featuresJsonObject)
Sets the features to this builder. The features are parsed from the given JSON object representation ofFeatures.- Parameters:
featuresJsonObject- JSON object representation of the features to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeaturesJsonObjectisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- iffeaturesJsonObjectcannot be parsed toFeatures.
-
setFeatures
ThingBuilder.FromCopy setFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate, org.eclipse.ditto.json.JsonObject featuresJsonObject)
Sets the features to this builder. The features are parsed from the given JSON object representation ofFeatures.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.featuresJsonObject- JSON object representation of the features to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- iffeaturesJsonObjectcannot be parsed toFeatures.
-
setFeatures
default ThingBuilder.FromCopy setFeatures(java.lang.String featuresJsonString)
Sets the Features of the Thing based on the given JSON object.- Parameters:
featuresJsonString- JSON string providing the Features of the Thing.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeaturesJsonStringisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- iffeaturesJsonStringcannot be parsed toFeatures.
-
setFeatures
ThingBuilder.FromCopy setFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.String featuresJsonString)
Sets the Features of the Thing based on the given JSON object.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether the provided features are set to the builder.featuresJsonString- JSON string providing the Features of the Thing.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- iffeaturesJsonStringcannot be parsed toFeatures.
-
setFeatures
default ThingBuilder.FromCopy setFeatures(java.lang.Iterable<Feature> features)
Sets the given Features to this builder.- Parameters:
features- the Features to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- iffeaturesisnull.
-
setFeatures
ThingBuilder.FromCopy setFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate, java.lang.Iterable<Feature> features)
Sets the given Features to this builder.- Parameters:
existingFeaturesPredicate- a predicate to decide whether the given features exist. The predicate receives the currently set features.features- the Features to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- if any argument isnull.
-
removeAllFeatures
default ThingBuilder.FromCopy removeAllFeatures()
Removes all features from this builder.- Returns:
- this builder to allow method chaining.
-
removeAllFeatures
ThingBuilder.FromCopy removeAllFeatures(java.util.function.Predicate<Features> existingFeaturesPredicate)
Removes all features from this builder.- Parameters:
existingFeaturesPredicate- a predicate which determines, based on the already set features, whether all features are removed from the builder.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingFeaturesPredicateisnull.
-
setNullFeatures
ThingBuilder.FromCopy setNullFeatures()
Sets features to this builder which represents semanticallynull. All already set features are discarded.- Returns:
- this builder to allow method chaining.
-
setLifecycle
default ThingBuilder.FromCopy setLifecycle(@Nullable ThingLifecycle lifecycle)
Sets the given lifecycle to this builder.- Parameters:
lifecycle- the lifecycle to be set.- Returns:
- this builder to allow method chaining.
-
setLifecycle
ThingBuilder.FromCopy setLifecycle(java.util.function.Predicate<ThingLifecycle> existingLifecyclePredicate, @Nullable ThingLifecycle lifecycle)
Sets the given lifecycle to this builder.- Parameters:
existingLifecyclePredicate- a predicate to decide whether the given lifecycle is set. The predicate receives the currently set lifecycle.lifecycle- the lifecycle to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingLifecyclePredicateisnull.
-
setRevision
default ThingBuilder.FromCopy setRevision(ThingRevision revision)
Sets the given revision to this builder.- Parameters:
revision- the revision to be set.- Returns:
- this builder to allow method chaining.
-
setRevision
ThingBuilder.FromCopy setRevision(java.util.function.Predicate<ThingRevision> existingRevisionPredicate, ThingRevision revision)
Sets the given revision to this builder.- Parameters:
existingRevisionPredicate- a predicate to decide whether the given revision is set. The predicate receives the currently set revision.revision- the revision to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingRevisionPredicateisnull.
-
setRevision
default ThingBuilder.FromCopy setRevision(long revisionNumber)
Sets the given revision number to this builder.- Parameters:
revisionNumber- the revision number to be set.- Returns:
- this builder to allow method chaining.
-
setRevision
ThingBuilder.FromCopy setRevision(java.util.function.Predicate<ThingRevision> existingRevisionPredicate, long revisionNumber)
Sets the given revision number to this builder.- Parameters:
existingRevisionPredicate- a predicate to decide whether the given revision is set. The predicate receives the currently set revision.revisionNumber- the revision number to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingRevisionPredicateisnull.
-
setModified
default ThingBuilder.FromCopy setModified(@Nullable java.time.Instant modified)
Sets the given modified to this builder.- Parameters:
modified- the modified to be set.- Returns:
- this builder to allow method chaining.
-
setModified
ThingBuilder.FromCopy setModified(java.util.function.Predicate<java.time.Instant> existingModifiedPredicate, @Nullable java.time.Instant modified)
Sets the given modified timestamp to this builder.- Parameters:
existingModifiedPredicate- a predicate to decide whether the given modified timestamp is set. The predicate receives the currently set modified timestamp.modified- the modified timestamp to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingModifiedPredicateisnull.
-
setCreated
default ThingBuilder.FromCopy setCreated(@Nullable java.time.Instant created)
Sets the given created timestamp to this builder.- Parameters:
created- the created timestamp to be set.- Returns:
- this builder to allow method chaining.
- Since:
- 1.2.0
-
setCreated
ThingBuilder.FromCopy setCreated(java.util.function.Predicate<java.time.Instant> existingCreatedPredicate, @Nullable java.time.Instant created)
Sets the given created timestamp to this builder.- Parameters:
existingCreatedPredicate- a predicate to decide whether the given created timestamp is set. The predicate receives the currently set created timestamp.created- the created to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingCreatedPredicateisnull.- Since:
- 1.2.0
-
setMetadata
default ThingBuilder.FromCopy setMetadata(@Nullable org.eclipse.ditto.base.model.entity.metadata.Metadata metadata)
Sets the given metadata to this builder.- Parameters:
metadata- the metadata to be set.- Returns:
- this builder to allow method chaining.
- Since:
- 1.2.0
-
setMetadata
ThingBuilder.FromCopy setMetadata(java.util.function.Predicate<org.eclipse.ditto.base.model.entity.metadata.Metadata> existingMetadataPredicate, @Nullable org.eclipse.ditto.base.model.entity.metadata.Metadata metadata)
Sets the given metadata to this builder.- Parameters:
existingMetadataPredicate- a predicate to decide whether the given metadata is set. The predicate receives the currently set metadata.metadata- the metadata to be set.- Returns:
- this builder to allow method chaining.
- Since:
- 1.2.0
-
setId
default ThingBuilder.FromCopy setId(@Nullable ThingId thingId)
Sets the given Thing ID to this builder. The ID is required to include the Thing's namespace.- Parameters:
thingId- the Thing ID to be set.- Returns:
- this builder to allow method chaining.
- Throws:
ThingIdInvalidException- ifthingIddoes not comply to the required pattern.
-
setId
ThingBuilder.FromCopy setId(java.util.function.Predicate<ThingId> existingIdPredicate, @Nullable ThingId thingId)
Sets the given Thing ID to this builder. The ID is required to include the Thing's namespace.- Parameters:
existingIdPredicate- a predicate to decide whether the given ID is set. The predicate receives the currently set Thing ID.thingId- the Thing ID to be set.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingIdPredicateisnull.ThingIdInvalidException- ifthingIddoes not comply to the required pattern.
-
setGeneratedId
default ThingBuilder.FromCopy setGeneratedId()
Sets a generated Thing ID to this builder.- Returns:
- this builder to allow method chaining.
-
setGeneratedId
ThingBuilder.FromCopy setGeneratedId(java.util.function.Predicate<ThingId> existingIdPredicate)
Sets a generated Thing ID to this builder.- Parameters:
existingIdPredicate- a predicate to decide whether the given ID is set. The predicate receives the currently set Thing ID.- Returns:
- this builder to allow method chaining.
- Throws:
java.lang.NullPointerException- ifexistingIdPredicateisnull.
-
build
Thing build()
Creates a new Thing object based on the data which was provided to this builder.- Returns:
- a new Thing object.
-
-