Class EnumDef

java.lang.Object
dev.quantumfusion.hyphen.codegen.def.MethodDef
dev.quantumfusion.hyphen.codegen.def.EnumDef
All Implemented Interfaces:
SerializerDef

public final class EnumDef extends MethodDef
  • Field Details

    • USE_CONSTANT_DYNAMIC

      public static boolean USE_CONSTANT_DYNAMIC
    • USE_CONSTANT_DYNAMIC_INVOKE

      public static boolean USE_CONSTANT_DYNAMIC_INVOKE
  • Constructor Details

  • Method Details

    • scan

      public void scan(SerializerHandler<?,​?> handler, Clazz clazz)
      Specified by:
      scan in class MethodDef
    • getValues

      public static <T extends Enum<T>> T[] getValues(MethodHandles.Lookup lookup, String name, Class<T[]> cls)
    • writeMethodGet

      protected void writeMethodGet(MethodHandler mh)
      Specified by:
      writeMethodGet in class MethodDef
    • writeMethodPut

      protected void writeMethodPut(MethodHandler mh, Runnable valueLoad)
      Specified by:
      writeMethodPut in class MethodDef
    • getStaticSize

      public int getStaticSize()
      Description copied from interface: SerializerDef
      This returns the absolute minimum size of the object.
      If the size is dependent on the runtime object itself this value will be appended to the measure methods results.
      Returns:
      Object Minimum encoding size
    • hasDynamicSize

      public boolean hasDynamicSize()
      Description copied from interface: SerializerDef
      If this is true it will request to generate the Measure method.
      If this is false only the static size amount will be used.
      Returns:
      if it has a Dynamic Size.
    • writeMethodMeasure

      protected void writeMethodMeasure(MethodHandler mh, Runnable valueLoad)
      Specified by:
      writeMethodMeasure in class MethodDef