Class ImmutableNamespace

    • Method Detail

      • name

        public String name()
        Overrides:
        name in class Namespace
        Returns:
        The computed-at-construction value of the name attribute
      • getId

        public String getId()
        Description copied from class: Content
        Unique id for this object.

        This id is unique for the entire lifetime of this Content object and persists across renames. Two content objects with the same key will have different id.

        Overrides:
        getId in class Namespace
        Returns:
        The computed-at-construction value of the id attribute
      • withElements

        public final ImmutableNamespace withElements​(String... elements)
        Copy the current immutable object with elements that replace the content of elements.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withElements

        public final ImmutableNamespace withElements​(Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of elements. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of elements elements to set
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableNamespace that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: name, id, elements.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • copyOf

        public static ImmutableNamespace copyOf​(Namespace instance)
        Creates an immutable copy of a Namespace value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable Namespace instance