Interface EquivalentConverter<T>

Type Parameters:
T - The specific type.
All Known Implementing Classes:
AutoWrapper, BukkitConverters.IgnoreNullConverter, EnumWrappers.AliasedEnumConverter, EnumWrappers.EnumConverter, EnumWrappers.FauxEnumConverter, EnumWrappers.IndexedEnumConverter

public interface EquivalentConverter<T>
Interface that converts generic objects into types and back.
  • Method Summary

    Modifier and Type
    Method
    Description
    getGeneric(T specific)
    Retrieve a copy of the generic type from a specific type.
    Retrieve a copy of the specific type using an instance of the generic type.
    Due to type erasure, we need to explicitly keep a reference to the specific type.
  • Method Details

    • getGeneric

      Object getGeneric(T specific)
      Retrieve a copy of the generic type from a specific type.

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

      Parameters:
      specific - - the specific type we need to copy.
      Returns:
      A copy of the specific type.
    • getSpecific

      T getSpecific(Object generic)
      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.

      Parameters:
      generic - - the generic type.
      Returns:
      The new specific type.
    • getSpecificType

      Class<T> getSpecificType()
      Due to type erasure, we need to explicitly keep a reference to the specific type.
      Returns:
      The specific type.