Class EnumWrappers.IndexedEnumConverter<T extends Enum<T>>

java.lang.Object
com.comphenix.protocol.wrappers.EnumWrappers.IndexedEnumConverter<T>
All Implemented Interfaces:
EquivalentConverter<T>
Enclosing class:
EnumWrappers

public static class EnumWrappers.IndexedEnumConverter<T extends Enum<T>> extends Object implements EquivalentConverter<T>
  • Constructor Details

    • IndexedEnumConverter

      public IndexedEnumConverter(Class<T> specificClass, Class<?> genericClass)
  • Method Details

    • getGeneric

      public Object getGeneric(T specific)
      Description copied from interface: EquivalentConverter
      Retrieve a copy of the generic type from a specific type.

      This is usually a native net.minecraft.server type in Minecraft.

      Specified by:
      getGeneric in interface EquivalentConverter<T extends Enum<T>>
      Parameters:
      specific - - the specific type we need to copy.
      Returns:
      A copy of the specific type.
    • getSpecific

      public T getSpecific(Object generic)
      Description copied from interface: EquivalentConverter
      Retrieve a copy of the specific type using an instance of the generic type.

      This is usually a wrapper type in the Bukkit API or ProtocolLib API.

      Specified by:
      getSpecific in interface EquivalentConverter<T extends Enum<T>>
      Parameters:
      generic - - the generic type.
      Returns:
      The new specific type.
    • getSpecificType

      public Class<T> getSpecificType()
      Description copied from interface: EquivalentConverter
      Due to type erasure, we need to explicitly keep a reference to the specific type.
      Specified by:
      getSpecificType in interface EquivalentConverter<T extends Enum<T>>
      Returns:
      The specific type.