Class Namespace

  • Direct Known Subclasses:
    ImmutableNamespace

    @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

      • getType

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

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

        Specified by:
        getType in class Content
      • name

        @NotNull
        @Derived
        public @NotNull String name()
      • getId

        @NotNull
        @Derived
        public @NotNull 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 Content
      • isEmpty

        @Redacted
        public boolean isEmpty()
      • getElements

        @NotNull
        public abstract @NotNull List<String> getElements()
      • of

        public static Namespace of​(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​(List<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.
      • parse

        public static Namespace parse​(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.
      • fromPathString

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

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