Class AbstractContainer<K>

java.lang.Object
com.marcusslover.plus.lib.container.AbstractContainer<K>
Type Parameters:
K - Value type.
Direct Known Subclasses:
MapContainer, SingleContainer

public abstract class AbstractContainer<K> extends Object
Abstract container that represents a parent of files, similar to a folder. Default implementations are MapContainer and SingleContainer.
  • Field Details

    • DEFAULT_GSON

      protected static final com.google.gson.Gson DEFAULT_GSON
    • parentFolder

      protected File parentFolder
  • Constructor Details

    • AbstractContainer

      public AbstractContainer()
  • Method Details

    • getGson

      @NotNull protected @NotNull com.google.gson.Gson getGson()
      Gets the Gson instance. By default, it is DEFAULT_GSON.
      Returns:
      Gson instance.
    • update

      public abstract void update(@NotNull K key)
      Push the updated object to the cache and save it to the file.
      Parameters:
      key - Key of the object.
    • loadAllData

      public abstract void loadAllData()
      Attempts to load all the data from the container. Look at InitialLoading for more information.