Package org.bukkit.inventory.meta.tags
Class ItemTagType.PrimitiveTagType<T>
- java.lang.Object
-
- org.bukkit.inventory.meta.tags.ItemTagType.PrimitiveTagType<T>
-
- Type Parameters:
T- the generic type of the primitive objects
- All Implemented Interfaces:
ItemTagType<T,T>
- Enclosing interface:
- ItemTagType<T,Z>
public static class ItemTagType.PrimitiveTagType<T> extends Object implements ItemTagType<T,T>
A default implementation that simply exists to pass on the retrieved or inserted value to the next layer. This implementation does not add any kind of logic, but is used to provide default implementations for the primitive types.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.bukkit.inventory.meta.tags.ItemTagType
ItemTagType.PrimitiveTagType<T>
-
-
Field Summary
-
Fields inherited from interface org.bukkit.inventory.meta.tags.ItemTagType
BYTE, BYTE_ARRAY, DOUBLE, FLOAT, INTEGER, INTEGER_ARRAY, LONG, LONG_ARRAY, SHORT, STRING, TAG_CONTAINER
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TfromPrimitive(T primitive, @NotNull ItemTagAdapterContext context)Creates a complex object based of the passed primitive value@NotNull Class<T>getComplexType()Returns the complex object type the primitive value resembles.@NotNull Class<T>getPrimitiveType()Returns the primitive data type of this tag.TtoPrimitive(T complex, @NotNull ItemTagAdapterContext context)Returns the primitive data that resembles the complex object passed to this method.
-
-
-
Method Detail
-
getPrimitiveType
@NotNull public @NotNull Class<T> getPrimitiveType()
Description copied from interface:ItemTagTypeReturns the primitive data type of this tag.- Specified by:
getPrimitiveTypein interfaceItemTagType<T,T>- Returns:
- the class
-
getComplexType
@NotNull public @NotNull Class<T> getComplexType()
Description copied from interface:ItemTagTypeReturns the complex object type the primitive value resembles.- Specified by:
getComplexTypein interfaceItemTagType<T,T>- Returns:
- the class type
-
toPrimitive
@NotNull public T toPrimitive(@NotNull T complex, @NotNull @NotNull ItemTagAdapterContext context)
Description copied from interface:ItemTagTypeReturns the primitive data that resembles the complex object passed to this method.- Specified by:
toPrimitivein interfaceItemTagType<T,T>- Parameters:
complex- the complex object instancecontext- the context this operation is running in- Returns:
- the primitive value
-
fromPrimitive
@NotNull public T fromPrimitive(@NotNull T primitive, @NotNull @NotNull ItemTagAdapterContext context)
Description copied from interface:ItemTagTypeCreates a complex object based of the passed primitive value- Specified by:
fromPrimitivein interfaceItemTagType<T,T>- Parameters:
primitive- the primitive valuecontext- the context this operation is running in- Returns:
- the complex object instance
-
-