public class Namespace
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
check(boolean expression,
java.lang.String message,
java.lang.Object... args) |
static void |
checkCatalog(Namespace namespace)
Check if the given catalog namespace is legal, throw an
IllegalNamespaceException if
it's illegal. |
static void |
checkMetalake(Namespace namespace)
Check if the given metalake namespace is legal, throw an
IllegalNamespaceException if
it's illegal. |
static void |
checkSchema(Namespace namespace)
Check if the given schema namespace is legal, throw an
IllegalNamespaceException if
it's illegal. |
static void |
checkTable(Namespace namespace)
Check if the given table namespace is legal, throw an
IllegalNamespaceException if it's
illegal. |
static Namespace |
empty()
Get an empty namespace.
|
boolean |
equals(java.lang.Object other) |
int |
hashCode() |
boolean |
isEmpty()
Check if the namespace is empty.
|
int |
length()
Get the length of the namespace.
|
java.lang.String |
level(int pos)
Get the level at the given position.
|
java.lang.String[] |
levels()
Get the levels of the namespace.
|
static Namespace |
of(java.lang.String... levels)
Create a namespace with the given levels.
|
static Namespace |
ofCatalog(java.lang.String metalake)
Create a namespace for catalog.
|
static Namespace |
ofMetalake()
Create a namespace for metalake.
|
static Namespace |
ofSchema(java.lang.String metalake,
java.lang.String catalog)
Create a namespace for schema.
|
static Namespace |
ofTable(java.lang.String metalake,
java.lang.String catalog,
java.lang.String schema)
Create a namespace for table.
|
java.lang.String |
toString() |
public static Namespace empty()
public static Namespace of(java.lang.String... levels)
levels
- The levels of the namespacepublic static Namespace ofMetalake()
public static Namespace ofCatalog(java.lang.String metalake)
metalake
- The metalake namepublic static Namespace ofSchema(java.lang.String metalake, java.lang.String catalog)
metalake
- The metalake namecatalog
- The catalog namepublic static Namespace ofTable(java.lang.String metalake, java.lang.String catalog, java.lang.String schema)
metalake
- The metalake namecatalog
- The catalog nameschema
- The schema namepublic static void checkMetalake(Namespace namespace)
IllegalNamespaceException
if
it's illegal.namespace
- The metalake namespacepublic static void checkCatalog(Namespace namespace)
IllegalNamespaceException
if
it's illegal.namespace
- The catalog namespacepublic static void checkSchema(Namespace namespace)
IllegalNamespaceException
if
it's illegal.namespace
- The schema namespacepublic static void checkTable(Namespace namespace)
IllegalNamespaceException
if it's
illegal.namespace
- The table namespacepublic java.lang.String[] levels()
public java.lang.String level(int pos)
pos
- The position of the levelpublic int length()
public boolean isEmpty()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static void check(boolean expression, java.lang.String message, java.lang.Object... args)