Package io.aether.utils
Class CType.WType<T>
- java.lang.Object
-
- io.aether.utils.CType<T>
-
- io.aether.utils.CType.WType<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.aether.utils.CType
CType.WType<T>
-
Nested classes/interfaces inherited from interface io.aether.utils.CTypeI
CTypeI.CompareEvent, CTypeI.FieldAccessor<T2>
-
-
Field Summary
-
Fields inherited from interface io.aether.utils.CTypeI
BOOLEAN, BOOLEAN_ARR, BOOLEAN_BOX, BYTE, BYTE_ARR, BYTE_BOX, CHAR, CHAR_BOX, CLASS_NAME, DOUBLE, DOUBLE_ARR, DOUBLE_BOX, FLOAT, FLOAT_ARR, FLOAT_BOX, INT, INT_ARR, INT_BOX, LONG, LONG_ARR, LONG_BOX, SHORT, SHORT_ARR, SHORT_BOX, STRING, UBYTE, UINT, ULONG, UNSIGNED, USHORT
-
-
Constructor Summary
Constructors Constructor Description WType(java.lang.reflect.TypeVariable<?> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CTypeI<T>addAnnotations(java.lang.annotation.Annotation... aa)Adds annotations to this type and returns a new type instance with the annotations.java.lang.StringdeclareCode()Gets the declaration code for this type, including annotations and type parameters.CTypeI<java.lang.Object>getComponentByName(java.lang.String name)Gets the component type by name for parameterized types.CTypeI<java.lang.Object>[]getParameters()Gets the type parameters for this type.CType<java.lang.Object>getParent()Gets the parent type of this type.java.lang.Class<T>getRaw()Gets the raw class representing this type.booleaninstanceOf(java.lang.reflect.Type t)Checks if this type is an instance of the specified type.booleanisBoxedPrimitive()Checks if this type represents a boxed primitive.booleanisPrimitive()Checks if this type represents a primitive type.CTypeI<java.lang.Object>resolveExtend(CTypeI<java.lang.Object> inf)Resolves the extended type for the specified interface in the context of this type.CTypeI<java.lang.Object>resolveReturnType(java.lang.reflect.Method m)Resolves the return type of the specified method in the context of this type.CTypeI<java.lang.Object>[]resolveTypeArgs(java.lang.reflect.Method m)Resolves the type arguments of the specified method in the context of this type.CTypeI<java.lang.Object>resolveTypeField(java.lang.reflect.Field f)Resolves the type of the specified field in the context of this type.CTypeI<T>toPrimitive()Converts this type to its primitive equivalent if it's a boxed primitive.@NotNull java.lang.reflect.TypetoType()Converts this type to a standard Type object.CTypeI<T>tryToBox()Attempts to box this type if it's a primitive.CTypeI<T>unbox()Unboxes this type if it's a boxed primitive.-
Methods inherited from class io.aether.utils.CType
cast, cast, compareValues, equals, getAllChildrenClasses, getAllDependencies, getAllFields, getAllMethods, getAnnotation, getAnnotations, getCanonicalName, getCanonicalNameWithParameters, getCanonicalNameWithParameters, getChildrenClasses, getClassLoader, getComponent, getComponent, getComponent, getConstructor, getEnumValues, getFieldAccessor, getFieldAccessor, getFields, getFieldVarHandle, getFieldVarHandle, getGenericVariables, getInterfaces, getMethods, getPackage, getRaw2, getRawSimpleName, getRawSimpleNameWithParameters, getRawSimpleNameWithParameters, hashCode, instanceOf, instanceOf, isAbstract, isAetherClass, isAnnotated, isArray, isBoxedOrRawPrimitive, isEnum, isInstance, isInterface, isNumber, isParameterizedType, isParametrizedClass, isVariable, makeAuto, maker, maker, mutable, toAnnotatedType, toArray, toId, toString, toString
-
-
-
-
Method Detail
-
getComponentByName
public CTypeI<java.lang.Object> getComponentByName(java.lang.String name)
Description copied from interface:CTypeIGets the component type by name for parameterized types.- Parameters:
name- the name of the type parameter- Returns:
- the component type, or null if not found
-
addAnnotations
public CTypeI<T> addAnnotations(java.lang.annotation.Annotation... aa)
Description copied from interface:CTypeIAdds annotations to this type and returns a new type instance with the annotations.- Specified by:
addAnnotationsin interfaceCTypeI<T>- Overrides:
addAnnotationsin classCType<T>- Parameters:
aa- the annotations to add- Returns:
- a new type instance with the added annotations
-
getRaw
public java.lang.Class<T> getRaw()
Description copied from interface:CTypeIGets the raw class representing this type.- Returns:
- the raw class
-
instanceOf
public boolean instanceOf(java.lang.reflect.Type t)
Description copied from interface:CTypeIChecks if this type is an instance of the specified type.- Parameters:
t- the type to check against- Returns:
- true if this type is an instance of the specified type, false otherwise
-
toType
@NotNull public @NotNull java.lang.reflect.Type toType()
Description copied from interface:CTypeIConverts this type to a standard Type object.- Returns:
- the Type representation
-
isPrimitive
public boolean isPrimitive()
Description copied from interface:CTypeIChecks if this type represents a primitive type.- Returns:
- true if this is a primitive type, false otherwise
-
resolveReturnType
public CTypeI<java.lang.Object> resolveReturnType(java.lang.reflect.Method m)
Description copied from interface:CTypeIResolves the return type of the specified method in the context of this type.- Parameters:
m- the method- Returns:
- the resolved return type
-
resolveTypeArgs
public CTypeI<java.lang.Object>[] resolveTypeArgs(java.lang.reflect.Method m)
Description copied from interface:CTypeIResolves the type arguments of the specified method in the context of this type.- Parameters:
m- the method- Returns:
- an array of resolved type arguments
-
resolveExtend
public CTypeI<java.lang.Object> resolveExtend(CTypeI<java.lang.Object> inf)
Description copied from interface:CTypeIResolves the extended type for the specified interface in the context of this type.- Parameters:
inf- the interface type- Returns:
- the resolved extended type
-
resolveTypeField
public CTypeI<java.lang.Object> resolveTypeField(java.lang.reflect.Field f)
Description copied from interface:CTypeIResolves the type of the specified field in the context of this type.- Parameters:
f- the field- Returns:
- the resolved field type
-
isBoxedPrimitive
public boolean isBoxedPrimitive()
Description copied from interface:CTypeIChecks if this type represents a boxed primitive.- Returns:
- true if this is a boxed primitive, false otherwise
-
toPrimitive
public CTypeI<T> toPrimitive()
Description copied from interface:CTypeIConverts this type to its primitive equivalent if it's a boxed primitive.- Returns:
- the primitive type
-
unbox
public CTypeI<T> unbox()
Description copied from interface:CTypeIUnboxes this type if it's a boxed primitive.- Returns:
- the unboxed type
-
getParameters
public CTypeI<java.lang.Object>[] getParameters()
Description copied from interface:CTypeIGets the type parameters for this type.- Returns:
- an array of type parameters
-
getParent
public CType<java.lang.Object> getParent()
Description copied from interface:CTypeIGets the parent type of this type.- Returns:
- the parent type, or null if none exists
-
tryToBox
public CTypeI<T> tryToBox()
Description copied from interface:CTypeIAttempts to box this type if it's a primitive.- Returns:
- the boxed type, or this type if not primitive
-
declareCode
public java.lang.String declareCode()
Description copied from interface:CTypeIGets the declaration code for this type, including annotations and type parameters.- Specified by:
declareCodein interfaceCTypeI<T>- Overrides:
declareCodein classCType<T>- Returns:
- the declaration code
-
-