Package org.eclipse.ditto.things.model
Class AttributesModelFactory
- java.lang.Object
-
- org.eclipse.ditto.things.model.AttributesModelFactory
-
@Immutable public final class AttributesModelFactory extends java.lang.ObjectFactory that creates newattributesobjects.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AttributesemptyAttributes()Returns a new immutable emptyAttributes.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 AttributesnullAttributes()Returns 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 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.org.eclipse.ditto.json.JsonPointerInvalidException- if an attribute name in the containedjsonObjectwas not valid according to patternRegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
-
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.
-
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
-
-