Package org.eclipse.ditto.things.model
Class ThingsModelFactory
java.lang.Object
org.eclipse.ditto.things.model.ThingsModelFactory
Factory that creates new
things objects.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributesReturns a new immutable emptyAttributes.static FeaturePropertiesReturns a new immutable emptyFeatureProperties.static FeaturesReturns a new immutable emptyFeatures.static org.eclipse.ditto.base.model.entity.metadata.MetadataReturns a new immutable emptyMetadata.static Stream<org.eclipse.ditto.json.JsonPointer>expandFeatureIdWildcard(Collection<org.eclipse.ditto.json.JsonKey> featureIds, org.eclipse.ditto.json.JsonPointer jsonPointer) Returns a stream ofJsonPointerwith expanded feature id wildcard.static org.eclipse.ditto.json.JsonFieldSelectorexpandFeatureIdWildcards(Collection<org.eclipse.ditto.json.JsonKey> featureIds, org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector) Returns a new instance ofJsonFieldSelectorwith expanded feature id wildcard.static org.eclipse.ditto.json.JsonFieldSelectorexpandFeatureIdWildcards(Features features, org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector) Returns a new instance ofJsonFieldSelectorwith expanded feature id wildcard.static AttributesnewAttributes(String jsonString) Returns a new immutableAttributeswhich is initialised with the values of the given JSON string.static AttributesnewAttributes(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new immutableAttributeswhich is initialised with the values of the given JSON object.static AttributesBuilderReturns a new empty builder for aAttributes.static AttributesBuildernewAttributesBuilder(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new builder for aAttributeswhich is initialised with the values of the given JSON object.static ThingDefinitionnewDefinition(CharSequence thingDefinition) Returns a new immutableThingDefinitionwhich is initialised with the parsedthingDefinition.static FeaturenewFeature(CharSequence featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties, FeatureProperties desiredFeatureProperties) Returns a new immutableFeaturewith the given ID, properties, desired Properties and Definition.static FeaturenewFeature(String featureId) Returns a new immutableFeaturewith the given ID.static FeaturenewFeature(String featureId, FeatureDefinition featureDefinition) Returns a new immutableFeaturewith the given ID, properties and Definition.static FeaturenewFeature(String featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties) Returns a new immutableFeaturewith the given ID, properties and Definition.static FeaturenewFeature(String featureId, FeatureProperties featureProperties) Returns a new immutableFeaturewith the given ID and properties.Returns a new builder for an immutableFeaturefrom scratch with a fluent API.newFeatureBuilder(String jsonString) Returns a new builder for an immutableFeaturewhich is initialised with the values of the given JSON string.newFeatureBuilder(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new builder for an immutableFeaturewhich is initialised with the values of the given JSON object.newFeatureBuilder(Feature feature) Returns a new builder for an immutableFeaturewhich is initialised with the values of the given Feature.static FeatureDefinitionnewFeatureDefinition(String jsonString) Returns a new immutableFeatureDefinitionwhich is initialised with the values of the given JSON string.static FeatureDefinitionnewFeatureDefinition(Collection<DefinitionIdentifier> definitionIdentifiers) Creates a new instance ofImmutableFeatureDefinitionbased on the passeddefinitionIdentifiers.static FeatureDefinitionnewFeatureDefinition(org.eclipse.ditto.json.JsonArray jsonArray) Parses the specified JsonArray and returns an immutable instance ofFeatureDefinitionwhich is initialised with the values of the given JSON array.static FeatureDefinitionBuildernewFeatureDefinitionBuilder(CharSequence firstIdentifier) Parses the specified CharSequence and returns a mutable builder with a fluent API for an immutableFeatureDefinition.static FeatureDefinitionBuildernewFeatureDefinitionBuilder(org.eclipse.ditto.json.JsonArray jsonArray) Returns a new builder for an immutableFeatureDefinitionwhich is initialised with the values of the given JSON array.static DefinitionIdentifiernewFeatureDefinitionIdentifier(CharSequence featureIdentifierAsCharSequence) Parses the specified CharSequence and returns an immutable instance ofDefinitionIdentifier.static DefinitionIdentifiernewFeatureDefinitionIdentifier(CharSequence namespace, CharSequence name, CharSequence version) Returns an immutable instance ofDefinitionIdentifier.static FeaturePropertiesnewFeatureProperties(String jsonString) Returns a new immutableFeaturePropertieswhich is initialised with the values of the given JSON string.static FeaturePropertiesnewFeatureProperties(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new immutableFeaturePropertieswhich is initialised with the values of the given JSON object.static FeaturePropertiesBuilderReturns a new empty builder for an immutableFeatureProperties.static FeaturePropertiesBuildernewFeaturePropertiesBuilder(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new builder for an immutableFeaturePropertieswhich is initialised with the values of the given JSON object.static FeaturesnewFeatures(Iterable<Feature> features) Returns a new immutableFeatureswhich is initialised with the features of the given Iterable.static FeaturesnewFeatures(String jsonString) Returns a new immutableFeaturesbased on the given JSON string.static FeaturesnewFeatures(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new immutableFeaturesbased on the given JSON object.static FeaturesnewFeatures(Feature feature, Feature... additionalFeatures) Returns a new immutableFeatureswhich is initialised with the given features.static FeaturesBuilderReturns a new mutable builder with a fluent API for an immutableFeatures.static FeaturesBuildernewFeaturesBuilder(Iterable<Feature> features) Returns a new mutable builder with a fluent API for an immutableFeatures.static org.eclipse.ditto.base.model.entity.metadata.MetadatanewMetadata(String jsonString) Returns a new immutableMetadatawhich is initialised with the values of the given JSON string.static org.eclipse.ditto.base.model.entity.metadata.MetadatanewMetadata(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new immutableMetadatawhich is initialised with the values of the given JSON object.static org.eclipse.ditto.base.model.entity.metadata.MetadataBuilderReturns a new empty builder for aMetadata.static org.eclipse.ditto.base.model.entity.metadata.MetadataBuildernewMetadataBuilder(org.eclipse.ditto.base.model.entity.metadata.Metadata metadata) Returns a new builder for aMetadatawhich is initialised with the values of the given Metadata.static ThingReturns a new immutableThingbased on the given JSON string.static ThingnewThing(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new immutableThingbased on the given JSON object.static ThingBuilder.FromScratchReturns a mutable builder with a fluent API for an immutableThingfrom scratch.static ThingBuilder.FromCopynewThingBuilder(String jsonString) Returns a mutable builder with a fluent API for an immutableThingbased on the given JSON string.static ThingBuilder.FromCopynewThingBuilder(org.eclipse.ditto.json.JsonObject jsonObject) Returns a mutable builder with a fluent API for an immutableThingbased on the given JSON object.static ThingBuilder.FromCopynewThingBuilder(Thing thing) Returns a mutable builder with a fluent API for an immutableThing.static ThingRevisionnewThingRevision(long revisionNumber) Returns a new immutableThingRevisionwhich is initialised with the given revision number.static AttributesReturns a new immutableAttributeswhich representsnull.static ThingDefinitionReturns a new immutableThingDefinitionwhich representsnull.static FeaturenullFeature(String featureId) Returns a new immutableFeaturewhich representsnull.static FeatureDefinitionReturns a new immutableFeatureDefinitionwhich representsnull.static FeaturePropertiesReturns a new immutableFeaturePropertieswhich representsnull.static FeaturesReturns a new immutableFeatureswhich representsnull.static org.eclipse.ditto.base.model.entity.metadata.MetadataReturns a new immutableMetadatawhich representsnull.static org.eclipse.ditto.json.JsonPointervalidateFeaturePropertyPointer(org.eclipse.ditto.json.JsonPointer jsonPointer) Validates the givenJsonPointerto a feature property.static voidvalidateJsonKeys(org.eclipse.ditto.json.JsonObject jsonObject) Validates the givenJsonObjectcontaining only valid keys.
-
Field Details
-
FEATURE_ID_WILDCARD
public static final org.eclipse.ditto.json.JsonKey FEATURE_ID_WILDCARD
-
-
Method Details
-
emptyAttributes
Returns a new immutable emptyAttributes.- Returns:
- the new immutable empty
Attributes.
-
nullAttributes
Returns a new immutableAttributeswhich representsnull.- Returns:
- the new
null-likeAttributes.
-
newAttributes
Returns a new immutableAttributeswhich is initialised with the values of the given JSON object.- Parameters:
jsonObject- provides the initial values of the result.- Returns:
- the new immutable initialised
Attributes. - Throws:
NullPointerException- ifjsonObjectisnull.
-
newAttributes
Returns a new immutableAttributeswhich is initialised with the values of the given JSON string. This string is required to be a validJsonObject.- Parameters:
jsonString- provides the initial values of the result;- Returns:
- the new immutable initialised
Attributes. - Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toAttributes.
-
newAttributesBuilder
Returns a new empty builder for aAttributes.- Returns:
- the builder.
-
newAttributesBuilder
Returns a new builder for aAttributeswhich is initialised with the values of the given JSON object.- Parameters:
jsonObject- provides the initial values of the result.- Returns:
- the builder.
- Throws:
NullPointerException- ifjsonObjectisnull.
-
newDefinition
Returns a new immutableThingDefinitionwhich is initialised with the parsedthingDefinition.- Parameters:
thingDefinition- Definition identifier which should be parsed as ThingDefinition.- Returns:
- new ThingDefinition with the parsed definition identifier.
-
nullDefinition
Returns a new immutableThingDefinitionwhich representsnull.- Returns:
- the new
null-likeThingDefinition.
-
newFeatureDefinitionIdentifier
public static DefinitionIdentifier newFeatureDefinitionIdentifier(CharSequence namespace, CharSequence name, CharSequence version) Returns an immutable instance ofDefinitionIdentifier.- Parameters:
namespace- the namespace of the returned Identifier.name- the name of the returned Identifier.version- the version of the returned Identifier.- Returns:
- the instance.
- Throws:
NullPointerException- if any argument isnull.IllegalArgumentException- if any argument is empty.
-
newFeatureDefinitionIdentifier
public static DefinitionIdentifier newFeatureDefinitionIdentifier(CharSequence featureIdentifierAsCharSequence) Parses the specified CharSequence and returns an immutable instance ofDefinitionIdentifier.- Parameters:
featureIdentifierAsCharSequence- CharSequence-representation of a FeatureDefinition Identifier.- Returns:
- the instance.
- Throws:
NullPointerException- iffeatureIdentifierAsCharSequenceisnull.DefinitionIdentifierInvalidException- iffeatureIdentifierAsCharSequenceis invalid.
-
newFeatureDefinition
public static FeatureDefinition newFeatureDefinition(Collection<DefinitionIdentifier> definitionIdentifiers) Creates a new instance ofImmutableFeatureDefinitionbased on the passeddefinitionIdentifiers.- Parameters:
definitionIdentifiers- the Identifiers of the FeatureDefinition to be returned.- Returns:
- the instance.
- Throws:
NullPointerException- ifdefinitionIdentifiersisnull.- Since:
- 3.0.0
-
newFeatureDefinition
Parses the specified JsonArray and returns an immutable instance ofFeatureDefinitionwhich is initialised with the values of the given JSON array.- Parameters:
jsonArray- JSON array containing the identifiers of the FeatureDefinition to be returned. Non-string values are ignored.- Returns:
- the instance.
- Throws:
NullPointerException- ifjsonArrayisnull.FeatureDefinitionEmptyException- ifjsonArrayis empty.DefinitionIdentifierInvalidException- if any Identifier string of the array is invalid.
-
newFeatureDefinition
Returns a new immutableFeatureDefinitionwhich is initialised with the values of the given JSON string. This string is required to be a validJsonArray.- Parameters:
jsonString- provides the initial values of the result;- Returns:
- the new immutable initialised
FeatureDefinition. - Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toFeatureDefinition.FeatureDefinitionEmptyException- if the JSON array is empty.DefinitionIdentifierInvalidException- if any Identifier of the JSON array is invalid.
-
nullFeatureDefinition
Returns a new immutableFeatureDefinitionwhich representsnull.- Returns:
- the new
null-likeFeatureDefinition.
-
newFeatureDefinitionBuilder
Parses the specified CharSequence and returns a mutable builder with a fluent API for an immutableFeatureDefinition. The returned builder is initialised with the parsed Identifier as its first one.- Parameters:
firstIdentifier- CharSequence-representation of the first FeatureDefinition Identifier.- Returns:
- the instance.
- Throws:
NullPointerException- iffirstIdentifierisnull.DefinitionIdentifierInvalidException- iffirstIdentifieris invalid.
-
newFeatureDefinitionBuilder
public static FeatureDefinitionBuilder newFeatureDefinitionBuilder(org.eclipse.ditto.json.JsonArray jsonArray) Returns a new builder for an immutableFeatureDefinitionwhich is initialised with the values of the given JSON array.- Parameters:
jsonArray- provides the initial values of the result.- Returns:
- the builder.
- Throws:
NullPointerException- ifjsonArrayisnull.DefinitionIdentifierInvalidException- if any Identifier of the array is invalid.
-
emptyFeatureProperties
Returns a new immutable emptyFeatureProperties.- Returns:
- the new immutable empty
FeatureProperties.
-
nullFeatureProperties
Returns a new immutableFeaturePropertieswhich representsnull.- Returns:
- the new
null-likeFeatureProperties.
-
newFeatureProperties
Returns a new immutableFeaturePropertieswhich is initialised with the values of the given JSON object.- Parameters:
jsonObject- provides the initial values of the result.- Returns:
- the new immutable initialised
FeatureProperties. - Throws:
NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.json.JsonKeyInvalidException- if a property name in the passedjsonObjectwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeatureProperties
Returns a new immutableFeaturePropertieswhich is initialised with the values of the given JSON string. This string is required to be a validJsonObject.- Parameters:
jsonString- provides the initial values of the result;- Returns:
- the new immutable initialised
FeatureProperties. - Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toFeatureProperties.
-
newFeaturePropertiesBuilder
Returns a new empty builder for an immutableFeatureProperties.- Returns:
- the builder.
-
newFeaturePropertiesBuilder
public static FeaturePropertiesBuilder newFeaturePropertiesBuilder(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new builder for an immutableFeaturePropertieswhich is initialised with the values of the given JSON object.- Parameters:
jsonObject- provides the initial values of the result.- Returns:
- the builder.
- Throws:
NullPointerException- ifjsonObjectisnull.
-
nullFeature
Returns a new immutableFeaturewhich representsnull.- Parameters:
featureId- the ID of the new Feature.- Returns:
- the new
null-likeFeature. - Throws:
NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
Returns a new immutableFeaturewith the given ID.- Parameters:
featureId- the ID of the new Feature.- Returns:
- the new immutable
Feature. - Throws:
NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
Returns a new immutableFeaturewith the given ID and properties.- Parameters:
featureId- the ID of the new feature.featureProperties- the properties of the new Feature ornull.- Returns:
- the new immutable
Feature. - Throws:
NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
Returns a new immutableFeaturewith the given ID, properties and Definition.- Parameters:
featureId- the ID of the new feature.featureDefinition- the Definition of the new Feature ornull.- Returns:
- the new immutable
Feature. - Throws:
NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
public static Feature newFeature(String featureId, @Nullable FeatureDefinition featureDefinition, @Nullable FeatureProperties featureProperties) Returns a new immutableFeaturewith the given ID, properties and Definition.- Parameters:
featureId- the ID of the new feature.featureDefinition- the Definition of the new Feature ornull.featureProperties- the properties of the new Feature ornull.- Returns:
- the new immutable
Feature. - Throws:
NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
public static Feature newFeature(CharSequence featureId, @Nullable FeatureDefinition featureDefinition, @Nullable FeatureProperties featureProperties, @Nullable FeatureProperties desiredFeatureProperties) Returns a new immutableFeaturewith the given ID, properties, desired Properties and Definition.- Parameters:
featureId- the ID of the new feature.featureDefinition- the Definition of the new Feature ornull.featureProperties- the properties of the new Feature ornull.desiredFeatureProperties- the desired properties of the new Feature ornull.- Returns:
- the new immutable
Feature. - Throws:
NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.- Since:
- 1.5.0
-
newFeatureBuilder
Returns a new builder for an immutableFeaturefrom scratch with a fluent API.- Returns:
- the builder.
-
newFeatureBuilder
Returns a new builder for an immutableFeaturewhich is initialised with the values of the given Feature.- Parameters:
feature- provides the initial values for the result.- Returns:
- the builder.
- Throws:
NullPointerException- iffeatureisnull.
-
newFeatureBuilder
public static FeatureBuilder.FromJsonBuildable newFeatureBuilder(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new builder for an immutableFeaturewhich is initialised with the values of the given JSON object.- Parameters:
jsonObject- provides the initial values for the result.- Returns:
- the builder.
- Throws:
NullPointerException- ifjsonObjectisnull.
-
newFeatureBuilder
Returns a new builder for an immutableFeaturewhich is initialised with the values of the given JSON string. The JSON string is parsed in a fault tolerant way. I. e. all properties which cannot be deserialized are supposed to not exist.- Parameters:
jsonString- string the JSON string representation of a Feature.- Returns:
- the builder.
- Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toFeature.- See Also:
-
emptyFeatures
Returns a new immutable emptyFeatures.- Returns:
- the new immutable empty
Features.
-
nullFeatures
Returns a new immutableFeatureswhich representsnull.- Returns:
- the new
null-likeFeatures.
-
newFeatures
Returns a new immutableFeatureswhich is initialised with the features of the given Iterable.- Parameters:
features- the features to initialise the result with.- Returns:
- the new immutable
Featureswhich is initialised withfeatures. - Throws:
NullPointerException- iffeaturesisnull.
-
newFeatures
Returns a new immutableFeaturesbased on the given JSON object.- Parameters:
jsonObject- provides the initial values for the result.- Returns:
- the new immutable
Featureswhich is initialised by the data ofjsonObject. - Throws:
NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- if any JSON field which is supposed to represent a Feature is not a JSON object.
-
newFeatures
Returns a new immutableFeaturesbased on the given JSON string.- Parameters:
jsonString- provides the initial values of the result.- Returns:
- the new immutable initialised
Features. - Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toFeatures.
-
newFeatures
Returns a new immutableFeatureswhich is initialised with the given features.- Parameters:
feature- the initial Feature of the result.additionalFeatures- additional features of the result.- Returns:
- the new immutable
Featureswhich is initialised withfeatureand potentially withadditionalFeatures. - Throws:
NullPointerException- if any argument isnull.
-
newFeaturesBuilder
Returns a new mutable builder with a fluent API for an immutableFeatures.- Returns:
- the builder.
-
newFeaturesBuilder
Returns a new mutable builder with a fluent API for an immutableFeatures. The builder is initialised with the given features.- Parameters:
features- the initial features of the new builder.- Returns:
- the builder.
- Throws:
NullPointerException- iffeaturesisnull.
-
validateFeaturePropertyPointer
public static org.eclipse.ditto.json.JsonPointer validateFeaturePropertyPointer(org.eclipse.ditto.json.JsonPointer jsonPointer) Validates the givenJsonPointerto a feature property.- Parameters:
jsonPointer-jsonPointerthat is validated- Returns:
- the same
jsonPointerif validation was successful - Throws:
org.eclipse.ditto.json.JsonKeyInvalidException- ifjsonPointerwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.- Since:
- 1.2.0
-
validateJsonKeys
public static void validateJsonKeys(org.eclipse.ditto.json.JsonObject jsonObject) Validates the givenJsonObjectcontaining only valid keys.- Parameters:
jsonObject-jsonObjectthat is validated- Throws:
org.eclipse.ditto.json.JsonKeyInvalidException- ifjsonObjectwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.- Since:
- 1.3.0
-
emptyMetadata
public static org.eclipse.ditto.base.model.entity.metadata.Metadata emptyMetadata()Returns a new immutable emptyMetadata.- Returns:
- the new immutable empty
Metadata. - Since:
- 1.2.0
-
nullMetadata
public static org.eclipse.ditto.base.model.entity.metadata.Metadata nullMetadata()Returns a new immutableMetadatawhich representsnull.- Returns:
- the new
null-likeMetadata. - Since:
- 1.2.0
-
newMetadata
public static org.eclipse.ditto.base.model.entity.metadata.Metadata newMetadata(org.eclipse.ditto.json.JsonObject jsonObject) Returns a new immutableMetadatawhich is initialised with the values of the given JSON object.- Parameters:
jsonObject- provides the initial values of the result.- Returns:
- the new immutable initialised
Metadata. - Throws:
NullPointerException- ifjsonObjectisnull.- Since:
- 1.2.0
-
newMetadata
Returns a new immutableMetadatawhich is initialised with the values of the given JSON string. This string is required to be a validJsonObject.- Parameters:
jsonString- provides the initial values of the result;- Returns:
- the new immutable initialised
Metadata. - Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toMetadata.- Since:
- 1.2.0
-
newMetadataBuilder
public static org.eclipse.ditto.base.model.entity.metadata.MetadataBuilder newMetadataBuilder()Returns a new empty builder for aMetadata.- Returns:
- the builder.
- Since:
- 1.2.0
-
newMetadataBuilder
public static org.eclipse.ditto.base.model.entity.metadata.MetadataBuilder newMetadataBuilder(org.eclipse.ditto.base.model.entity.metadata.Metadata metadata) Returns a new builder for aMetadatawhich is initialised with the values of the given Metadata.- Parameters:
metadata- provides the initial values of the result.- Returns:
- the builder.
- Throws:
NullPointerException- ifmetadataisnull.- Since:
- 1.2.0
-
newThingRevision
Returns a new immutableThingRevisionwhich is initialised with the given revision number.- Parameters:
revisionNumber- thelongvalue of the revision.- Returns:
- the new immutable
ThingRevision.
-
newThing
Returns a new immutableThingbased on the given JSON object.- Parameters:
jsonObject- the JSON object representation of a Thing.- Returns:
- the new Thing.
- Throws:
NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonObjectcannot be parsed toThing.
-
newThing
Returns a new immutableThingbased on the given JSON string.- Parameters:
jsonString- the JSON string representation of a Thing.- Returns:
- the new Thing.
- Throws:
NullPointerException- ifjsonStringisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toThing.
-
newThingBuilder
Returns a mutable builder with a fluent API for an immutableThingfrom scratch.- Returns:
- the new builder.
-
newThingBuilder
Returns a mutable builder with a fluent API for an immutableThingbased on the given JSON object. The JSON object is parsed in a fault-tolerant way. I.e. all properties which cannot be deserialized are supposed to not exist.- Parameters:
jsonObject- the JSON object representation of a Thing.- Returns:
- the new builder.
- Throws:
NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonObjectcannot be parsed toThing.
-
newThingBuilder
Returns a mutable builder with a fluent API for an immutableThingbased on the given JSON string. The JSON string is parsed in a fault-tolerant way. I.e. all properties which cannot be deserialized are supposed to not exist.- Parameters:
jsonString- string the JSON string representation of a Thing.- Returns:
- the new builder.
- Throws:
org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toThing.- See Also:
-
newThingBuilder
Returns a mutable builder with a fluent API for an immutableThing. The builder is initialised with the properties of the given Thing.- Parameters:
thing- the Thing which provides the initial properties of the builder.- Returns:
- the new builder.
- Throws:
NullPointerException- ifthingisnull.
-
expandFeatureIdWildcards
public static org.eclipse.ditto.json.JsonFieldSelector expandFeatureIdWildcards(Features features, org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector) Returns a new instance ofJsonFieldSelectorwith expanded feature id wildcard.- Returns:
- the new instance.
- Since:
- 2.3.0
-
expandFeatureIdWildcards
public static org.eclipse.ditto.json.JsonFieldSelector expandFeatureIdWildcards(Collection<org.eclipse.ditto.json.JsonKey> featureIds, org.eclipse.ditto.json.JsonFieldSelector jsonFieldSelector) Returns a new instance ofJsonFieldSelectorwith expanded feature id wildcard.- Returns:
- the new instance.
- Since:
- 2.3.0
-
expandFeatureIdWildcard
public static Stream<org.eclipse.ditto.json.JsonPointer> expandFeatureIdWildcard(Collection<org.eclipse.ditto.json.JsonKey> featureIds, org.eclipse.ditto.json.JsonPointer jsonPointer) Returns a stream ofJsonPointerwith expanded feature id wildcard.- Returns:
- a stream of
JsonPointer. - Since:
- 2.3.0
-