T - the value type@NonnullByDefault public interface MetadataKey<T> extends TypeAware<T>
MetadataMap.
Unlike a normal map key, a MetadataKey also holds the type of the values mapped to it.
static <T> MetadataKey<T> create(String id, TypeToken<T> type)
T - the value typeid - the id of the keytype - the type of the value mapped to this keystatic <T> MetadataKey<T> create(String id, Class<T> clazz)
T - the value typeid - the id of the keyclazz - the class type of the value mapped to this keystatic MetadataKey<Empty> createEmptyKey(String id)
static MetadataKey<String> createStringKey(String id)
static MetadataKey<Boolean> createBooleanKey(String id)
static MetadataKey<Integer> createIntegerKey(String id)
static MetadataKey<Long> createLongKey(String id)
static MetadataKey<Double> createDoubleKey(String id)
static MetadataKey<Float> createFloatKey(String id)
static MetadataKey<Short> createShortKey(String id)
static MetadataKey<Character> createCharacterKey(String id)
static MetadataKey<Cooldown> createCooldownKey(String id)
static MetadataKey<UUID> createUuidKey(String id)
String getId()
T cast(Object object) throws ClassCastException
object - the object to be castedClassCastException - if the object cannot be castedCopyright © 2020. All rights reserved.