Interface IMemoryStorage

All Known Implementing Classes:
MemoryStorage

@PowerNukkitXOnly @Since("1.19.50-r1") public interface IMemoryStorage
记忆存储器
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    clear(MemoryType<?> type)
    清空指定记忆类型数据为null
    default <D> boolean
    使用指定的数据对比记忆类型存储的数据
    <D> D
    get(MemoryType<D> type)
    从指定记忆类型获取数据
    获取所有记忆
    default boolean
    检查指定记忆类型数据是否为空(null)
    default boolean
    检查指定记忆类型数据是否不为空(null)
    <D> void
    put(MemoryType<D> type, D data)
    写入数据到记忆类型
  • Method Details

    • put

      <D> void put(MemoryType<D> type, D data)
      写入数据到记忆类型
      Type Parameters:
      D - 数据类型
      Parameters:
      type - 记忆类型
      data - 数据
    • get

      <D> D get(MemoryType<D> type)
      从指定记忆类型获取数据
      Type Parameters:
      D - 数据类型
      Parameters:
      type - 记忆类型
      Returns:
      数据
    • getAll

      Map<MemoryType<?>,?> getAll()
      获取所有记忆
      Returns:
      所有记忆
    • clear

      void clear(MemoryType<?> type)
      清空指定记忆类型数据为null
      Parameters:
      type - 记忆类型
    • isEmpty

      default boolean isEmpty(MemoryType<?> type)
      检查指定记忆类型数据是否为空(null)
      Parameters:
      type - 记忆类型
      Returns:
      是否为空
    • notEmpty

      default boolean notEmpty(MemoryType<?> type)
      检查指定记忆类型数据是否不为空(null)
      Parameters:
      type - 记忆类型
      Returns:
      是否不为空
    • compareDataTo

      default <D> boolean compareDataTo(MemoryType<D> type, Object to)
      使用指定的数据对比记忆类型存储的数据
      Parameters:
      type - 记忆类型
      to - 指定的数据
      Returns:
      是否相同