# 接口的使用
org.bukkit.persistence.PersistentDataType

使用PersistentDataType的程序包
程序包
说明
org.bukkit.persistence
用于向各种对象附加持久化数据的类.

- ## org.bukkit.persistence中PersistentDataType的使用

  org.bukkit.persistence中PersistentDataType的子接口
  修饰符和类型
  接口
  说明
  `interface`
  `ListPersistentDataType<P,C>`
  The list persistent data represents a data type that is capable of storing a list of other data types in a `PersistentDataContainer`.
  实现PersistentDataType的org.bukkit.persistence中的类
  修饰符和类型
  类
  说明
  `static class`
  `PersistentDataType.BooleanPersistentDataType`
  A convenience implementation to convert between Byte and Boolean as there is no native implementation for booleans.
  `static class`
  `PersistentDataType.PrimitivePersistentDataType<P>`
  A default implementation that simply exists to pass on the retrieved or inserted value to the next layer.
  声明为PersistentDataType的org.bukkit.persistence中的字段
  修饰符和类型
  字段
  说明
  `static final PersistentDataType<Byte,Boolean>`
  PersistentDataType.`BOOLEAN`
  A convenience implementation to convert between Byte and Boolean as there is no native implementation for booleans.
  `static final PersistentDataType<Byte,Byte>`
  PersistentDataType.`BYTE`
  `static final PersistentDataType<byte[],byte[]>`
  PersistentDataType.`BYTE_ARRAY`
  `static final PersistentDataType<Double,Double>`
  PersistentDataType.`DOUBLE`
  `static final PersistentDataType<Float,Float>`
  PersistentDataType.`FLOAT`
  `static final PersistentDataType<Integer,Integer>`
  PersistentDataType.`INTEGER`
  `static final PersistentDataType<int[],int[]>`
  PersistentDataType.`INTEGER_ARRAY`
  `static final PersistentDataType<Long,Long>`
  PersistentDataType.`LONG`
  `static final PersistentDataType<long[],long[]>`
  PersistentDataType.`LONG_ARRAY`
  `static final PersistentDataType<Short,Short>`
  PersistentDataType.`SHORT`
  `static final PersistentDataType<String,String>`
  PersistentDataType.`STRING`
  `static final PersistentDataType<PersistentDataContainer,PersistentDataContainer>`
  PersistentDataType.`TAG_CONTAINER`
  `static final PersistentDataType<PersistentDataContainer[],PersistentDataContainer[]>`
  PersistentDataType.`TAG_CONTAINER_ARRAY`
  已过时。
  Use `LIST`'s `ListPersistentDataTypeProvider.dataContainers()` instead as `ListPersistentDataType`s offer full support for primitive types, such as the `PersistentDataContainer`.
  返回PersistentDataType的org.bukkit.persistence中的方法
  修饰符和类型
  方法
  说明
  `@NotNull PersistentDataType<P,C>`
  ListPersistentDataType.`elementType()`
  Provides the persistent data type of the elements found in the list.
  参数类型为PersistentDataType的org.bukkit.persistence中的方法
  修饰符和类型
  方法
  说明
  `<P, C> C`
  PersistentDataContainer.`get(@NotNull NamespacedKey key, @NotNull PersistentDataType<P,C> type)`
  Returns the metadata value that is stored on the `PersistentDataHolder` instance.
  `<P, C> C`
  PersistentDataContainer.`getOrDefault(@NotNull NamespacedKey key, @NotNull PersistentDataType<P,C> type, C defaultValue)`
  Returns the metadata value that is stored on the `PersistentDataHolder` instance.
  `<P, C> boolean`
  PersistentDataContainer.`has(@NotNull NamespacedKey key, @NotNull PersistentDataType<P,C> type)`
  Returns if the persistent metadata provider has metadata registered matching the provided parameters.
  `<P, C> @NotNull ListPersistentDataType<P,C>`
  ListPersistentDataTypeProvider.`listTypeFrom(@NotNull PersistentDataType<P,C> elementType)`
  Constructs a new list persistent data type given any persistent data type for its elements.
  `<P, C> void`
  PersistentDataContainer.`set(@NotNull NamespacedKey key, @NotNull PersistentDataType<P,C> type, C value)`
  Stores a metadata value on the `PersistentDataHolder` instance.