Class Namespace


  • @Immutable
    public abstract class Namespace
    extends Content
    For a given table name a.b.c.tableName, the Namespace would be the prefix a.b.c, since the last element tableName always represents the name of the actual table and is not included in the Namespace itself. Therefore, the Namespace is always consisting of the first N-1 elements.
    • Field Detail

    • Constructor Detail

      • Namespace

        public Namespace()
    • Method Detail

      • builder

        public static org.projectnessie.model.ImmutableNamespace.Builder builder()
      • getType

        public Content.Type getType()
        Description copied from class: Content
        Returns the Content.Type value for this content object.

        The name of the returned value should match the JSON type name used for serializing the content object.

        Specified by:
        getType in class Content
      • name

        @NotNull
        @NotNull
        @Derived
        public @NotNull @NotNull java.lang.String name()
      • isEmpty

        @Redacted
        public boolean isEmpty()
      • getElements

        @NotNull
        @NotNull
        public abstract @NotNull @NotNull java.util.List<java.lang.String> getElements()
      • getElementsArray

        @Redacted
        public java.lang.String[] getElementsArray()
      • getElementCount

        @Redacted
        public int getElementCount()
      • getParent

        @Redacted
        public Namespace getParent()
      • getProperties

        @NotNull
        @NotNull
        public abstract @NotNull @NotNull java.util.Map<java.lang.String,​java.lang.String> getProperties()
      • of

        public static Namespace of​(ContentKey contentKey)
        Builds a Namespace using the elements of the given content key.
        Parameters:
        contentKey - key with the elements for the namespace
        Returns:
        new namespace
      • of

        public static Namespace of​(java.lang.String... elements)
        Builds a Namespace instance for the given elements.
        Parameters:
        elements - The elements to build the namespace from.
        Returns:
        The constructed Namespace instance. If elements is empty, then name() will be an empty string.
      • of

        public static Namespace of​(java.util.Map<java.lang.String,​java.lang.String> properties,
                                   java.lang.String... elements)
        Builds a Namespace instance for the given elements and the given properties.
        Parameters:
        elements - The elements to build the namespace from.
        properties - The namespace properties.
        Returns:
        The constructed Namespace instance. If elements is empty, then name() will be an empty string.
      • of

        public static Namespace of​(java.util.List<java.lang.String> elements)
        Builds a Namespace instance for the given elements.
        Parameters:
        elements - The elements to build the namespace from.
        Returns:
        The constructed Namespace instance. If elements is empty, then name() will be an empty string.
      • of

        public static Namespace of​(java.util.List<java.lang.String> elements,
                                   java.util.Map<java.lang.String,​java.lang.String> properties)
        Builds a Namespace instance for the given elements and the given properties.
        Parameters:
        elements - The elements to build the namespace from.
        properties - The properties of the namespace.
        Returns:
        The constructed Namespace instance. If elements is empty, then name() will be an empty string.
      • parse

        public static Namespace parse​(java.lang.String identifier)
        Builds a Namespace instance for the given elements split by the . (dot) character.
        Parameters:
        identifier - The identifier to build the namespace from.
        Returns:
        Splits the given identifier by . and returns a Namespace instance. If identifier is empty, then name() will be an empty string.
      • isSameOrSubElementOf

        public boolean isSameOrSubElementOf​(Namespace parent)
        Checks whether the current Namespace is the same as or a sub-element of the given Namespace instance by comparing each canonical element.
        Parameters:
        parent - Namespace instance to compare with.
        Returns:
        true if the current Namespace is the same as or a sub-element of the given Namespace instance by comparing each canonical element, false otherwise.
      • fromPathString

        public static Namespace fromPathString​(java.lang.String encoded)
        Convert from path encoded string to normal string.
        Parameters:
        encoded - Path encoded string
        Returns:
        Actual key.
      • toPathString

        public java.lang.String toPathString()
        Convert this namespace to a URL encoded path string.
        Returns:
        String encoded for path use.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object