Package com.comphenix.protocol.reflect
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 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.
-
Method Details
-
getGeneric
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
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
Due to type erasure, we need to explicitly keep a reference to the specific type.- Returns:
- The specific type.
-