Class Clazz
java.lang.Object
dev.quantumfusion.hyphen.scan.type.Clazz
- Direct Known Subclasses:
ArrayClazz,ParaClazz,TypeClazz,UnknownClazz
This is a basic Class which is a class and holds annotations.
There are multiple implementations of this and all are listed in the
Any Clazz instance may be an
dev.quantumfusion.hyphen.scan.type package.
Any Clazz instance may be an
UnknownClazz.UNKNOWN which is when Hyphen cannot find out what the class is.
ArrayClazz An Array. It may be an array or a Type Array which comes from a parameter.
ParaClazz A Parameterised class. This is a class which holds class parameters.
These parameters may be UnknownClazz.UNKNOWN and that means they were unable to be determended
TypeClazz A Type Class. This is a class which comes from a Type of the parent class.
To get its actual clazz use TypeClazz.getDefinedClass()
UnknownClazz An Unknown class that may be caused of using wildcards or raw types.
-
Field Summary
FieldsModifier and TypeFieldDescription@NotNull Class<?>protected Map<Class<? extends Annotation>,Object>protected SerializerHandler<?,?> -
Constructor Summary
ConstructorsModifierConstructorDescriptionClazz(SerializerHandler<?,?> handler, @NotNull Class<?> aClass)protectedClazz(SerializerHandler<?,?> handler, @NotNull Class<?> aClass, Map<Class<? extends Annotation>,Object> annotations) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsAnnotation(Class<? extends Annotation> aClass)Checks if the Annotation exists on this clazz.static Clazzcreate(SerializerHandler<?,?> handler, AnnotatedType type, @Nullable Clazz ctx)Tries to define a type.intdefined()booleangetAnnotationValue(Class<? extends Annotation> aClass)Get an annotation value.Class<?>Gets the class that is in actual bytecode.Class<?>Gets the class that may have been tracked across parameters and types.inthashCode()toString()
-
Field Details
-
aClass
-
handler
-
annotations
-
-
Constructor Details
-
Clazz
protected Clazz(SerializerHandler<?,?> handler, @NotNull @NotNull Class<?> aClass, Map<Class<? extends Annotation>,Object> annotations) -
Clazz
-
-
Method Details
-
create
public static Clazz create(SerializerHandler<?,?> handler, AnnotatedType type, @Nullable @Nullable Clazz ctx) -
getAnnotationValue
Get an annotation value. To see if the value is null or the annotation does not exist usecontainsAnnotation(Class)before using this- Parameters:
aClass- The Annotation class- Returns:
- The value. If the annotation does not hold a value the value might be
null
-
containsAnnotation
Checks if the Annotation exists on this clazz.- Parameters:
aClass- The Annotation class- Returns:
- if it exists on this clazz
-
getDefinedClass
Gets the class that may have been tracked across parameters and types. This is the class you want to encode/decode.- Returns:
- The Defined class
-
getBytecodeClass
Gets the class that is in actual bytecode. In the case of types it may beObjectbut it may also be the bound.- Returns:
- The Bytecode class
-
define
Tries to define a type.- Parameters:
typeName- The Class Type name- Returns:
- The Possible Clazz. Else
UnknownClazz.UNKNOWN
-
asSub
-
getFields
-
defined
public int defined() -
toString
-
equals
-
hashCode
public int hashCode()
-