LogicalType (record)
A generalization of Java’s class type to also hold a logical name, which can be supplied lazily.
Equality is driven by the corresponding class exclusively, meaning the logical name is ignored in order to not cause any side-effects on logical name memoization eg. it happening too early.
Meta-model validators will take care, that there is no logical name ambiguity: There cannot be any LogicalTypes sharing the same corresponding class while having different logical names.
API
record LogicalType {
LogicalType(String logicalName, Class<?> correspondingClass)
LogicalType eager(Class<?> correspondingClass, String logicalName) (1)
LogicalType fqcn(Class<?> correspondingClass) (2)
LogicalType infer(Class<?> correspondingClass)
String className() (3)
String logicalSimpleName() (4)
String namespace() (5)
String logicalNameFormatted(String root, String delimiter) (6)
boolean equals(Object obj)
boolean isEqualTo(LogicalType other)
int hashCode()
int compareTo(LogicalType other)
Class<?> getCorrespondingClass() (7)
String getLogicalTypeName() (8)
String getClassName() (9)
String getLogicalTypeSimpleName() (10)
String getNamespace() (11)
String getLogicalTypeNameFormatted(String root, String delimiter) (12)
}
1 | eager(Class, String)
Returns a new TypeIdentifier based on the corresponding class and (ahead of time) known logicalName . |
||
2 | fqcn(Class)
Use the corresponding class’s fully qualified name for the logicalName . Most likely used in testing scenarios. |
||
3 | className()
Canonical name of the corresponding class. |
||
4 | logicalSimpleName()
The logical type name consists of 2 parts, the namespace and the logical simple name . |
||
5 | namespace()
The logical type name consists of 2 parts, the namespace and the logical simple name . |
||
6 | logicalNameFormatted(String, String)
The logical type name consists of 2 parts, the namespace and the logical simple name . Returns a concatenation of namespace , delimiter and the logical simple name , whereas in the absence of a namespace returns a concatenation of root and the logical simple name . |
||
7 | getCorrespondingClass()
|
||
8 | getLogicalTypeName()
|
||
9 | getClassName()
|
||
10 | getLogicalTypeSimpleName()
|
||
11 | getNamespace()
|
||
12 | getLogicalTypeNameFormatted(String, String)
|
Members
eager(Class, String)
Returns a new TypeIdentifier based on the corresponding class and (ahead of time) known logicalName .
fqcn(Class)
Use the corresponding class’s fully qualified name for the logicalName . Most likely used in testing scenarios.
logicalSimpleName()
The logical type name consists of 2 parts, the namespace and the logical simple name .
Returns the logical simple name part.
namespace()
The logical type name consists of 2 parts, the namespace and the logical simple name .
Returns the namespace part.
logicalNameFormatted(String, String)
The logical type name consists of 2 parts, the namespace and the logical simple name . Returns a concatenation of namespace , delimiter and the logical simple name , whereas in the absence of a namespace returns a concatenation of root and the logical simple name .