Package com.comphenix.protocol.wrappers
Class EnumWrappers.FauxEnumConverter<T extends Enum<T>>
java.lang.Object
com.comphenix.protocol.wrappers.EnumWrappers.FauxEnumConverter<T>
- Type Parameters:
T- Generic type
- All Implemented Interfaces:
EquivalentConverter<T>
- Enclosing class:
EnumWrappers
public static class EnumWrappers.FauxEnumConverter<T extends Enum<T>>
extends Object
implements EquivalentConverter<T>
Used for classes where it's an enum in everything but name
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGeneric(T specific) Retrieve a copy of the generic type from a specific type.getSpecific(Object generic) 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.
-
Constructor Details
-
FauxEnumConverter
-
-
Method Details
-
getGeneric
Description copied from interface:EquivalentConverterRetrieve a copy of the generic type from a specific type.This is usually a native net.minecraft.server type in Minecraft.
- Specified by:
getGenericin interfaceEquivalentConverter<T extends Enum<T>>- Parameters:
specific- - the specific type we need to copy.- Returns:
- A copy of the specific type.
-
getSpecific
Description copied from interface:EquivalentConverterRetrieve 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:
getSpecificin interfaceEquivalentConverter<T extends Enum<T>>- Parameters:
generic- - the generic type.- Returns:
- The new specific type.
-
getSpecificType
Description copied from interface:EquivalentConverterDue to type erasure, we need to explicitly keep a reference to the specific type.- Specified by:
getSpecificTypein interfaceEquivalentConverter<T extends Enum<T>>- Returns:
- The specific type.
-