Type metadata properties and methods

The type Type is the root type of all types. Every Type includes metadata properties and methods, such as the DisplayName property and the isAssignableFrom method. You use the Type property of a type to access the metadata. Although the metadata properties are available directly on the type, best practice is to use the Type property because static properties on a type override Type properties of the same name.

General type metadata

General type metadata is available for all types of data. Some of the properties and methods available in general type metadata are described in the following list. For a complete list of properties and methods, refer to the PolicyCenter Javadoc.
Abstract
If the type is abstract, this property is true.
Array
If the type is an array, this property is true.
DisplayName
The human-readable name of the type.
Final
If the type is final, this property is true.
GenericType

If the type is a parameterized type, this property is the raw generic type of the type.

If the type is a raw generic type, this property is this type.

If the type is neither a parameterized type nor a raw generic type, this property is null.

For example, for a type of ArrayList<String>, the GenericType property is java.util.ArrayList.

Interface
If the type is an interface, this property is true.
isAssignableFrom

If the type is assignable from a variable of a specified type, this method returns true.

Boxed types, such as Boolean and Integer, can be assigned to and from other boxed types only. If either variable type referenced in the isAssignableFrom expression is a primitive, such as boolean or int, the method returns false.

isGenericType

If the type is a raw generic type, this method returns true.

For example, for the type ArrayList<String>, this method returns false. For the type java.util.ArrayList, this method returns true.

ParameterizedType

If the type is parameterized, this property is true.

For example, for the type ArrayList<String>, this property is true. For the raw generic type of java.util.ArrayList, this property is false.

Primitive
If the type is primitive, this property is true.
Supertype
The supertype of the type. If no supertype exists, this property is null.
TypeInfo
Contains metadata about properties and methods of the type.

Type metadata for entities and typekeys

Gosu typekeys and some Gosu entities have additional type metadata that is not included with the general metadata. For example, Gosu typekeys have a metadata method called getTypeKeysByCategories that is available only on typekey data types. To access the entity and typekey metadata, reference the data’s TYPE property and get method. The code sample below demonstrates the appropriate syntax.

var myTypekeys = new TypeKey[10]
NoteSecurityType.TYPE.get().getTypeKeysByCategories(myTypekeys)

The TYPE property is available only on Gosu entity and typekey data types.