Package com.comphenix.protocol.wrappers
Class EnumWrappers.AliasedEnumConverter<T extends Enum<T> & EnumWrappers.AliasedEnum>
java.lang.Object
com.comphenix.protocol.wrappers.EnumWrappers.AliasedEnumConverter<T>
- All Implemented Interfaces:
EquivalentConverter<T>
- Enclosing class:
EnumWrappers
public static class EnumWrappers.AliasedEnumConverter<T extends Enum<T> & EnumWrappers.AliasedEnum>
extends Object
implements EquivalentConverter<T>
Enums whose name has changed across NMS versions. Enums using this must also implement
EnumWrappers.AliasedEnum-
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
-
AliasedEnumConverter
-
-
Method Details
-
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> & EnumWrappers.AliasedEnum>- Parameters:
generic- - the generic type.- Returns:
- The new specific type.
-
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> & EnumWrappers.AliasedEnum>- Parameters:
specific- - the specific type we need to copy.- Returns:
- A copy of the 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> & EnumWrappers.AliasedEnum>- Returns:
- The specific type.
-