Class Namespace

java.lang.Object
org.projectnessie.model.Content
org.projectnessie.model.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 Details

  • Constructor Details

    • Namespace

      public Namespace()
  • Method Details

    • 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 String name()
    • isEmpty

      @Redacted public boolean isEmpty()
    • getElements

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

      @Redacted public String[] getElementsArray()
    • getElementCount

      @Redacted public int getElementCount()
    • getParent

      @Redacted public Namespace getParent()
    • getParentOrEmpty

      @Redacted public Namespace getParentOrEmpty()
    • getProperties

      @NotNull @NotNull public abstract @NotNull @NotNull Map<String,String> getProperties()
    • withId

      public abstract Namespace withId(String id)
      Specified by:
      withId in class Content
    • 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(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(Map<String,String> properties, String... elements)
      Builds a Namespace instance for the given elements and the given properties.
      Parameters:
      properties - The namespace properties.
      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.
    • of

      public static Namespace of(List<String> elements, Map<String,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(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(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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toContentKey

      public ContentKey toContentKey()