Module qilletni.api
Class QilletniTypeClass<T extends QilletniType>
java.lang.Object
dev.qilletni.api.lang.types.typeclass.QilletniTypeClass<T>
- Type Parameters:
T- TheQilletniTypethis type class represents
- Direct Known Subclasses:
EntityPlaceholderTypeClass
Represents the class of a QilletniType, used for type checking and conversion. This is conceptually comparable to a
Class in Java. An entity-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final QilletniTypeClass<AlbumType> static final QilletniTypeClass<AnyType> static final QilletniTypeClass<BooleanType> static final QilletniTypeClass<CollectionType> static final QilletniTypeClass<DoubleType> static final QilletniTypeClass<FunctionType> static final QilletniTypeClass<ImportAliasType> static final QilletniTypeClass<IntType> static final QilletniTypeClass<JavaType> static final QilletniTypeClass<ListType> static final QilletniTypeClass<SongType> static final QilletniTypeClass<StringType> static final QilletniTypeClass<WeightsType> -
Constructor Summary
ConstructorsConstructorDescriptionQilletniTypeClass(EntityDefinition entityDefinition, String typeName) QilletniTypeClass(EntityDefinition entityDefinition, String typeName, QilletniTypeClass<?> subType) -
Method Summary
Modifier and TypeMethodDescriptionstatic QilletniTypeClass<EntityType> createEntityTypePlaceholder(String entityName) Used as a generic entity type for when the definition (or scope) is not yet known.static QilletniTypeClass<ListType> createListOfType(QilletniTypeClass<?> subType) Creates aQilletniTypeClassfor a list of the given type.booleanGets theEntityDefinitionif this is not a native type (viaisNativeType()).Class<?> Gets the internal type of the type class, as .If the type contains a subtype, such as a list, this returns it.Gets the string representation of the type.inthashCode()booleanisAssignableFrom(QilletniTypeClass<?> type) Checks if the internal type of this type class is assignable from the given type class.booleanIf this type class is native to Qilletni.toString()static List<QilletniTypeClass<?>> types()Gets allQilletniTypeClasses that are native to Qilletni.
-
Field Details
-
ANY
-
INT
-
DOUBLE
-
BOOLEAN
-
STRING
-
COLLECTION
-
SONG
-
ALBUM
-
WEIGHTS
-
FUNCTION
-
LIST
-
JAVA
-
IMPORT_ALIAS
-
-
Constructor Details
-
QilletniTypeClass
-
QilletniTypeClass
public QilletniTypeClass(EntityDefinition entityDefinition, String typeName, QilletniTypeClass<?> subType)
-
-
Method Details
-
createListOfType
Creates aQilletniTypeClassfor a list of the given type.- Parameters:
subType- The subtype of the list, aka what type the list contains- Returns:
- The created
QilletniTypeClass
-
createEntityTypePlaceholder
Used as a generic entity type for when the definition (or scope) is not yet known. This should only be compared to real types and not actually used- Returns:
- The created
QilletniTypeClass
-
isNativeType
public boolean isNativeType()If this type class is native to Qilletni. This is true if this does not represent an entity.- Returns:
- If the type is native to Qilletni
-
getInternalType
Gets the internal type of the type class, as .- Returns:
- The class of the type
-
isAssignableFrom
-
getEntityDefinition
Gets theEntityDefinitionif this is not a native type (viaisNativeType()).- Returns:
- The definition of the entity, or null if this is a native type
-
getTypeName
Gets the string representation of the type. If this is an entity, it will be the entity's name.- Returns:
- The name of the type
-
getSubType
If the type contains a subtype, such as a list, this returns it.- Returns:
- The subtype of the type, or null if there is none
-
types
Gets allQilletniTypeClasses that are native to Qilletni.- Returns:
- All native types
-
equals
-
hashCode
-
toString
-