Class AttributesModelFactory


  • @Immutable
    public final class AttributesModelFactory
    extends java.lang.Object
    Factory that creates new attributes objects.
    • Method Detail

      • emptyAttributes

        public static Attributes emptyAttributes()
        Returns a new immutable empty Attributes.
        Returns:
        the new immutable empty Attributes.
      • nullAttributes

        public static Attributes nullAttributes()
        Returns a new immutable Attributes which represents null.
        Returns:
        the new null-like Attributes.
      • newAttributes

        public static Attributes newAttributes​(org.eclipse.ditto.json.JsonObject jsonObject)
        Returns a new immutable Attributes which 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 - if jsonObject is null.
        org.eclipse.ditto.json.JsonPointerInvalidException - if an attribute name in the contained jsonObject was not valid according to pattern RegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
      • newAttributes

        public static Attributes newAttributes​(java.lang.String jsonString)
        Returns a new immutable Attributes which is initialised with the values of the given JSON string. This string is required to be a valid JsonObject.
        Parameters:
        jsonString - provides the initial values of the result;
        Returns:
        the new immutable initialised Attributes.
        Throws:
        org.eclipse.ditto.base.model.exceptions.DittoJsonException - if jsonString cannot be parsed to Attributes.
      • newAttributesBuilder

        public static AttributesBuilder newAttributesBuilder()
        Returns a new empty builder for a Attributes.
        Returns:
        the builder.
      • newAttributesBuilder

        public static AttributesBuilder newAttributesBuilder​(org.eclipse.ditto.json.JsonObject jsonObject)
        Returns a new builder for a Attributes which 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 - if jsonObject is null.
      • validateAttributePointer

        public static org.eclipse.ditto.json.JsonPointer validateAttributePointer​(org.eclipse.ditto.json.JsonPointer jsonPointer)
        Validates the given attribute JsonPointer.
        Parameters:
        jsonPointer - jsonPointer that is validated
        Returns:
        the same jsonPointer if validation was successful
        Throws:
        org.eclipse.ditto.json.JsonKeyInvalidException - if jsonPointer was not valid according to pattern RegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
        Since:
        1.2.0
      • validateAttributeKeys

        public static void validateAttributeKeys​(org.eclipse.ditto.json.JsonObject jsonObject)
        Validates the given attribute JsonObject.
        Parameters:
        jsonObject - jsonObject that is validated
        Throws:
        org.eclipse.ditto.json.JsonKeyInvalidException - if jsonObject was not valid according to pattern RegexPatterns.NO_CONTROL_CHARS_NO_SLASHES_PATTERN.
        Since:
        1.3.0