LogicalType

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

LogicalType.java
class LogicalType {
  LogicalType lazy(Class<?> correspondingClass, Supplier<String> logicalNameProvider)     (1)
  LogicalType eager(Class<?> correspondingClass, String logicalName)     (2)
  LogicalType fqcn(Class<?> correspondingClass)     (3)
  LogicalType infer(Class<?> correspondingClass)     (4)
  String getClassName()     (5)
  String getLogicalTypeName()     (6)
  String getLogicalTypeSimpleName()     (7)
  String getNamespace()     (8)
  String getLogicalTypeNameFormatted(String root, String delimiter)     (9)
  boolean equals(Object obj)
  boolean isEqualTo(LogicalType other)
  int hashCode()
  int compareTo(LogicalType other)
}
1 lazy(Class, Supplier)

Returns a new LogicalType based on the corresponding class and a logicalNameProvider for lazy logical name lookup.

2 eager(Class, String)

Returns a new TypeIdentifier based on the corresponding class and (ahead of time) known logicalName .

3 fqcn(Class)

Use the corresponding class’s fully qualified name for the logicalName . Most likely used in testing scenarios.

4 infer(Class)

Infer from annotations.

5 getClassName()

Canonical name of the corresponding class.

6 getLogicalTypeName()

Returns the logical-type-name (unique amongst non-abstract classes), as per the LogicalTypeFacet .

7 getLogicalTypeSimpleName()

The logical type name consists of 2 parts, the namespace and the logical simple name .

8 getNamespace()

The logical type name consists of 2 parts, the namespace and the logical simple name .

9 getLogicalTypeNameFormatted(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 .

Members

lazy(Class, Supplier)

Returns a new LogicalType based on the corresponding class and a logicalNameProvider for lazy logical name lookup.

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.

infer(Class)

Infer from annotations.

getClassName()

Canonical name of the corresponding class.

getLogicalTypeName()

Returns the logical-type-name (unique amongst non-abstract classes), as per the LogicalTypeFacet .

This will typically be the value of the Named#value() annotation attribute. If none has been specified then will default to the fully qualified class name (with ClassSubstitutorRegistry class name substituted if necessary to allow for runtime bytecode enhancement.

The ObjectSpecification can be retrieved using SpecificationLoader#specForLogicalTypeName(String) } passing the logical-type-name as argument.

getLogicalTypeSimpleName()

The logical type name consists of 2 parts, the namespace and the logical simple name .

Returns the logical simple name part.

getNamespace()

The logical type name consists of 2 parts, the namespace and the logical simple name .

Returns the namespace part.

getLogicalTypeNameFormatted(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 .