Class Clazz

java.lang.Object
dev.quantumfusion.hyphen.scan.type.Clazz
Direct Known Subclasses:
ArrayClazz, ParaClazz, TypeClazz, UnknownClazz

public class Clazz extends Object
This is a basic Class which is a class and holds annotations. There are multiple implementations of this and all are listed in the 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 Details

  • Constructor Details

  • Method Details

    • create

      public static Clazz create(SerializerHandler<?,​?> handler, AnnotatedType type, @Nullable @Nullable Clazz ctx)
    • getAnnotationValue

      public Object getAnnotationValue(Class<? extends Annotation> aClass)
      Get an annotation value. To see if the value is null or the annotation does not exist use containsAnnotation(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

      public boolean containsAnnotation(Class<? extends Annotation> aClass)
      Checks if the Annotation exists on this clazz.
      Parameters:
      aClass - The Annotation class
      Returns:
      if it exists on this clazz
    • getDefinedClass

      public Class<?> 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

      public Class<?> getBytecodeClass()
      Gets the class that is in actual bytecode. In the case of types it may be Object but it may also be the bound.
      Returns:
      The Bytecode class
    • define

      public Clazz define(String typeName)
      Tries to define a type.
      Parameters:
      typeName - The Class Type name
      Returns:
      The Possible Clazz. Else UnknownClazz.UNKNOWN
    • asSub

      public Clazz asSub(Class<?> sub)
    • getFields

      public List<FieldEntry> getFields()
    • defined

      public int defined()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object