Package org.eclipse.ditto.things.model
Class ThingsModelFactory
- java.lang.Object
-
- org.eclipse.ditto.things.model.ThingsModelFactory
-
@Immutable public final class ThingsModelFactory extends java.lang.ObjectFactory that creates newthingsobjects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AttributesemptyAttributes()Returns a new immutable emptyAttributes.static FeaturePropertiesemptyFeatureProperties()Returns a new immutable emptyFeatureProperties.static FeaturesemptyFeatures()Returns a new immutable emptyFeatures.static org.eclipse.ditto.base.model.entity.metadata.MetadataemptyMetadata()Returns a new immutable emptyMetadata.static AttributesnewAttributes(java.lang.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 AttributesBuildernewAttributesBuilder()Returns 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(java.lang.CharSequence thingDefinition)Returns a new immutableThingDefinitionwhich is initialised with the parsedthingDefinition.static FeaturenewFeature(java.lang.CharSequence featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties, FeatureProperties desiredFeatureProperties)Returns a new immutableFeaturewith the given ID, properties, desired Properties and Definition.static FeaturenewFeature(java.lang.String featureId)Returns a new immutableFeaturewith the given ID.static FeaturenewFeature(java.lang.String featureId, FeatureDefinition featureDefinition)Returns a new immutableFeaturewith the given ID, properties and Definition.static FeaturenewFeature(java.lang.String featureId, FeatureDefinition featureDefinition, FeatureProperties featureProperties)Returns a new immutableFeaturewith the given ID, properties and Definition.static FeaturenewFeature(java.lang.String featureId, FeatureProperties featureProperties)Returns a new immutableFeaturewith the given ID and properties.static FeatureBuilder.FromScratchBuildablenewFeatureBuilder()Returns a new builder for an immutableFeaturefrom scratch with a fluent API.static FeatureBuilder.FromJsonBuildablenewFeatureBuilder(java.lang.String jsonString)Returns a new builder for an immutableFeaturewhich is initialised with the values of the given JSON string.static FeatureBuilder.FromJsonBuildablenewFeatureBuilder(org.eclipse.ditto.json.JsonObject jsonObject)Returns a new builder for an immutableFeaturewhich is initialised with the values of the given JSON object.static FeatureBuilder.FromCopyBuildablenewFeatureBuilder(Feature feature)Returns a new builder for an immutableFeaturewhich is initialised with the values of the given Feature.static FeatureDefinitionnewFeatureDefinition(java.lang.String jsonString)Returns a new immutableFeatureDefinitionwhich is initialised with the values of the given JSON string.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(java.lang.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(java.lang.CharSequence featureIdentifierAsCharSequence)Parses the specified CharSequence and returns an immutable instance ofDefinitionIdentifier.static DefinitionIdentifiernewFeatureDefinitionIdentifier(java.lang.CharSequence namespace, java.lang.CharSequence name, java.lang.CharSequence version)Returns an immutable instance ofDefinitionIdentifier.static FeaturePropertiesnewFeatureProperties(java.lang.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 FeaturePropertiesBuildernewFeaturePropertiesBuilder()Returns 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(java.lang.Iterable<Feature> features)Returns a new immutableFeatureswhich is initialised with the features of the given Iterable.static FeaturesnewFeatures(java.lang.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 FeaturesBuildernewFeaturesBuilder()Returns a new mutable builder with a fluent API for an immutableFeatures.static FeaturesBuildernewFeaturesBuilder(java.lang.Iterable<Feature> features)Returns a new mutable builder with a fluent API for an immutableFeatures.static org.eclipse.ditto.base.model.entity.metadata.MetadatanewMetadata(java.lang.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.MetadataBuildernewMetadataBuilder()Returns 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 ThingnewThing(java.lang.String jsonString)Returns 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.FromScratchnewThingBuilder()Returns a mutable builder with a fluent API for an immutableThingfrom scratch.static ThingBuilder.FromCopynewThingBuilder(java.lang.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 AttributesnullAttributes()Returns a new immutableAttributeswhich representsnull.static ThingDefinitionnullDefinition()Returns a new immutableThingDefinitionwhich representsnull.static FeaturenullFeature(java.lang.String featureId)Returns a new immutableFeaturewhich representsnull.static FeatureDefinitionnullFeatureDefinition()Returns a new immutableFeatureDefinitionwhich representsnull.static FeaturePropertiesnullFeatureProperties()Returns a new immutableFeaturePropertieswhich representsnull.static FeaturesnullFeatures()Returns a new immutableFeatureswhich representsnull.static org.eclipse.ditto.base.model.entity.metadata.MetadatanullMetadata()Returns 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.
-
-
-
Method Detail
-
emptyAttributes
public static Attributes emptyAttributes()
Returns a new immutable emptyAttributes.- Returns:
- the new immutable empty
Attributes.
-
nullAttributes
public static Attributes nullAttributes()
Returns a new immutableAttributeswhich representsnull.- Returns:
- the new
null-likeAttributes.
-
newAttributes
public static Attributes newAttributes(org.eclipse.ditto.json.JsonObject jsonObject)
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:
java.lang.NullPointerException- ifjsonObjectisnull.
-
newAttributes
public static Attributes newAttributes(java.lang.String jsonString)
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
public static AttributesBuilder newAttributesBuilder()
Returns a new empty builder for aAttributes.- Returns:
- the builder.
-
newAttributesBuilder
public static AttributesBuilder newAttributesBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
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:
java.lang.NullPointerException- ifjsonObjectisnull.
-
newDefinition
public static ThingDefinition newDefinition(@Nullable java.lang.CharSequence thingDefinition)
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
public static ThingDefinition nullDefinition()
Returns a new immutableThingDefinitionwhich representsnull.- Returns:
- the new
null-likeThingDefinition.
-
newFeatureDefinitionIdentifier
public static DefinitionIdentifier newFeatureDefinitionIdentifier(java.lang.CharSequence namespace, java.lang.CharSequence name, java.lang.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:
java.lang.NullPointerException- if any argument isnull.java.lang.IllegalArgumentException- if any argument is empty.
-
newFeatureDefinitionIdentifier
public static DefinitionIdentifier newFeatureDefinitionIdentifier(java.lang.CharSequence featureIdentifierAsCharSequence)
Parses the specified CharSequence and returns an immutable instance ofDefinitionIdentifier.- Parameters:
featureIdentifierAsCharSequence- CharSequence-representation of a FeatureDefinition Identifier.- Returns:
- the instance.
- Throws:
java.lang.NullPointerException- iffeatureIdentifierAsCharSequenceisnull.DefinitionIdentifierInvalidException- iffeatureIdentifierAsCharSequenceis invalid.
-
newFeatureDefinition
public static FeatureDefinition newFeatureDefinition(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.- Parameters:
jsonArray- JSON array containing the identifiers of the FeatureDefinition to be returned. Non-string values are ignored.- Returns:
- the instance.
- Throws:
java.lang.NullPointerException- ifjsonArrayisnull.FeatureDefinitionEmptyException- ifjsonArrayis empty.DefinitionIdentifierInvalidException- if any Identifier string of the array is invalid.
-
newFeatureDefinition
public static FeatureDefinition newFeatureDefinition(java.lang.String jsonString)
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
public static FeatureDefinition nullFeatureDefinition()
Returns a new immutableFeatureDefinitionwhich representsnull.- Returns:
- the new
null-likeFeatureDefinition.
-
newFeatureDefinitionBuilder
public static FeatureDefinitionBuilder newFeatureDefinitionBuilder(java.lang.CharSequence firstIdentifier)
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:
java.lang.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:
java.lang.NullPointerException- ifjsonArrayisnull.DefinitionIdentifierInvalidException- if any Identifier of the array is invalid.
-
emptyFeatureProperties
public static FeatureProperties emptyFeatureProperties()
Returns a new immutable emptyFeatureProperties.- Returns:
- the new immutable empty
FeatureProperties.
-
nullFeatureProperties
public static FeatureProperties nullFeatureProperties()
Returns a new immutableFeaturePropertieswhich representsnull.- Returns:
- the new
null-likeFeatureProperties.
-
newFeatureProperties
public static FeatureProperties newFeatureProperties(org.eclipse.ditto.json.JsonObject jsonObject)
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:
java.lang.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
public static FeatureProperties newFeatureProperties(java.lang.String jsonString)
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
public static FeaturePropertiesBuilder 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:
java.lang.NullPointerException- ifjsonObjectisnull.
-
nullFeature
public static Feature nullFeature(java.lang.String featureId)
Returns a new immutableFeaturewhich representsnull.- Parameters:
featureId- the ID of the new Feature.- Returns:
- the new
null-likeFeature. - Throws:
java.lang.NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
public static Feature newFeature(java.lang.String featureId)
Returns a new immutableFeaturewith the given ID.- Parameters:
featureId- the ID of the new Feature.- Returns:
- the new immutable
Feature. - Throws:
java.lang.NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
public static Feature newFeature(java.lang.String featureId, @Nullable FeatureProperties featureProperties)
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:
java.lang.NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
public static Feature newFeature(java.lang.String featureId, @Nullable FeatureDefinition featureDefinition)
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:
java.lang.NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
public static Feature newFeature(java.lang.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:
java.lang.NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
newFeature
public static Feature newFeature(java.lang.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:
java.lang.NullPointerException- iffeatureIdisnull.org.eclipse.ditto.json.JsonKeyInvalidException- iffeatureIdwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.- Since:
- 1.5.0
-
newFeatureBuilder
public static FeatureBuilder.FromScratchBuildable newFeatureBuilder()
Returns a new builder for an immutableFeaturefrom scratch with a fluent API.- Returns:
- the builder.
-
newFeatureBuilder
public static FeatureBuilder.FromCopyBuildable newFeatureBuilder(Feature feature)
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:
java.lang.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:
java.lang.NullPointerException- ifjsonObjectisnull.
-
newFeatureBuilder
public static FeatureBuilder.FromJsonBuildable newFeatureBuilder(java.lang.String jsonString)
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:
newFeatureBuilder(JsonObject)
-
emptyFeatures
public static Features emptyFeatures()
Returns a new immutable emptyFeatures.- Returns:
- the new immutable empty
Features.
-
nullFeatures
public static Features nullFeatures()
Returns a new immutableFeatureswhich representsnull.- Returns:
- the new
null-likeFeatures.
-
newFeatures
public static Features newFeatures(java.lang.Iterable<Feature> features)
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:
java.lang.NullPointerException- iffeaturesisnull.
-
newFeatures
public static Features newFeatures(org.eclipse.ditto.json.JsonObject jsonObject)
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:
java.lang.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
public static Features newFeatures(java.lang.String jsonString)
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
public static Features newFeatures(Feature feature, Feature... additionalFeatures)
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:
java.lang.NullPointerException- if any argument isnull.
-
newFeaturesBuilder
public static FeaturesBuilder newFeaturesBuilder()
Returns a new mutable builder with a fluent API for an immutableFeatures.- Returns:
- the builder.
-
newFeaturesBuilder
public static FeaturesBuilder newFeaturesBuilder(java.lang.Iterable<Feature> features)
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:
java.lang.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:
java.lang.NullPointerException- ifjsonObjectisnull.- Since:
- 1.2.0
-
newMetadata
public static org.eclipse.ditto.base.model.entity.metadata.Metadata newMetadata(java.lang.String jsonString)
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:
java.lang.NullPointerException- ifmetadataisnull.- Since:
- 1.2.0
-
newThingRevision
public static ThingRevision newThingRevision(long revisionNumber)
Returns a new immutableThingRevisionwhich is initialised with the given revision number.- Parameters:
revisionNumber- thelongvalue of the revision.- Returns:
- the new immutable
ThingRevision.
-
newThing
public static Thing newThing(org.eclipse.ditto.json.JsonObject jsonObject)
Returns a new immutableThingbased on the given JSON object.- Parameters:
jsonObject- the JSON object representation of a Thing.- Returns:
- the new Thing.
- Throws:
java.lang.NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonObjectcannot be parsed toThing.
-
newThing
public static Thing newThing(java.lang.String jsonString)
Returns a new immutableThingbased on the given JSON string.- Parameters:
jsonString- the JSON string representation of a Thing.- Returns:
- the new Thing.
- Throws:
java.lang.NullPointerException- ifjsonStringisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonStringcannot be parsed toThing.
-
newThingBuilder
public static ThingBuilder.FromScratch newThingBuilder()
Returns a mutable builder with a fluent API for an immutableThingfrom scratch.- Returns:
- the new builder.
-
newThingBuilder
public static ThingBuilder.FromCopy newThingBuilder(org.eclipse.ditto.json.JsonObject jsonObject)
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:
java.lang.NullPointerException- ifjsonObjectisnull.org.eclipse.ditto.base.model.exceptions.DittoJsonException- ifjsonObjectcannot be parsed toThing.
-
newThingBuilder
public static ThingBuilder.FromCopy newThingBuilder(java.lang.String jsonString)
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(JsonObject)
-
newThingBuilder
public static ThingBuilder.FromCopy newThingBuilder(Thing thing)
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:
java.lang.NullPointerException- ifthingisnull.
-
-