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)
Check the given condition is true.
|
static void |
checkCatalog(Namespace namespace)
Check if the given catalog namespace is legal, throw an
IllegalNamespaceException if
it's illegal. |
static void |
checkFileset(Namespace namespace)
Check if the given fileset 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 void |
checkTopic(Namespace namespace)
Check if the given topic 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 |
ofFileset(java.lang.String metalake,
java.lang.String catalog,
java.lang.String schema)
Create a namespace for fileset.
|
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.
|
static Namespace |
ofTopic(java.lang.String metalake,
java.lang.String catalog,
java.lang.String schema)
Create a namespace for topic.
|
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 Namespace ofFileset(java.lang.String metalake, java.lang.String catalog, java.lang.String schema)
metalake
- The metalake namecatalog
- The catalog nameschema
- The schema namepublic static Namespace ofTopic(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 static void checkFileset(Namespace namespace)
IllegalNamespaceException
if
it's illegal.namespace
- The fileset namespacepublic static void checkTopic(Namespace namespace)
IllegalNamespaceException
if it's
illegal.namespace
- The topic 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
@FormatMethod public static void check(boolean expression, @FormatString java.lang.String message, java.lang.Object... args)
IllegalNamespaceException
if it's not.expression
- The expression to check.message
- The message to throw.args
- The arguments to the message.