Package org.eclipse.ditto.things.model
Class AttributesModelFactory
java.lang.Object
org.eclipse.ditto.things.model.AttributesModelFactory
Factory that creates new
attributes objects.-
Method Summary
Modifier and TypeMethodDescriptionstatic AttributesReturns a new immutable emptyAttributes.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 AttributesReturns a new immutableAttributeswhich representsnull.static voidvalidateAttributeKeys(org.eclipse.ditto.json.JsonObject jsonObject) Validates the given attributeJsonObject.static org.eclipse.ditto.json.JsonPointervalidateAttributePointer(org.eclipse.ditto.json.JsonPointer jsonPointer) Validates the given attributeJsonPointer.
-
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.org.eclipse.ditto.json.JsonPointerInvalidException- if an attribute name in the containedjsonObjectwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
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.
-
validateAttributePointer
public static org.eclipse.ditto.json.JsonPointer validateAttributePointer(org.eclipse.ditto.json.JsonPointer jsonPointer) Validates the given attributeJsonPointer.- 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
-
validateAttributeKeys
public static void validateAttributeKeys(org.eclipse.ditto.json.JsonObject jsonObject) Validates the given attributeJsonObject.- 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
-