Interface Container<T>

Type Parameters:
T - Type of contained entries.
All Known Subinterfaces:
BrushContainer, PresetContainer

public interface Container<T>
An interface which represents a container which holds named entries of any type.
  • Field Details

    • GLOBAL

      static final UUID GLOBAL
  • Method Details

    • get

      Get a entry by name
      Parameters:
      name - name of entry
      Returns:
      optional containing the entry if found
    • add

      CompletableFuture<Void> add(T preset)
      Add an entry
      Parameters:
      preset - entry to add
      Returns:
      A future which will completes once the entry was added
    • all

      Get all presets in this container
      Returns:
      A future which contains an unmodifiable collection of all entries.
    • paged

      Returns an object which should provide access to entry pages of this container.
      Returns:
      container pages
    • remove

      Remove a entry by name
      Parameters:
      name - name of entry
      Returns:
      A future which completes once the entry got remove. Will be true if the entry was removed.
    • names

      Set<String> names()
      Returns all names in this container
      Returns:
      set of names
    • size

      Get the amount of entries in this container.
      Returns:
      A future providing the size of the container.
    • owner

      @NotNull @NotNull UUID owner()
      Get the owner of the container.

      This might be the uuid of the owning player or GLOBAL when it is a global container.

      Returns:
      owner uuid
    • isGlobalContainer

      default boolean isGlobalContainer()
      Checks if the owner() is equal to GLOBAL
      Returns:
      true if this container has the global UUID
    • migrate

      default void migrate(Container<T> container)
      Migrate the container into this container. This will override entries if they already exist with the same name. This will not remove already existing entries.
      Parameters:
      container - container with entries to add.