Class AbstractManager<I, C, T extends C>

java.lang.Object
me.lucko.luckperms.common.model.manager.AbstractManager<I,C,T>
Type Parameters:
I - the class used to identify each object held in this manager
C - the super class being managed
T - the implementation class this manager is "managing"
All Implemented Interfaces:
Function<I,T>, Manager<I,C,T>
Direct Known Subclasses:
AbstractGroupManager, AbstractTrackManager, AbstractUserManager

public abstract class AbstractManager<I, C, T extends C> extends Object implements Manager<I,C,T>
An abstract manager class
  • Constructor Details

    • AbstractManager

      public AbstractManager()
  • Method Details

    • getAll

      public Map<I,T> getAll()
      Description copied from interface: Manager
      Gets a map containing all cached instances held by this manager.
      Specified by:
      getAll in interface Manager<I, C, T extends C>
      Returns:
      all instances held in this manager
    • getOrMake

      public T getOrMake(I id)
      Description copied from interface: Manager
      Gets or creates an object by id

      Should only every be called by the storage implementation.

      Specified by:
      getOrMake in interface Manager<I, C, T extends C>
      Parameters:
      id - The id to search by
      Returns:
      a T object if the object is loaded or makes and returns a new object
    • getIfLoaded

      public T getIfLoaded(I id)
      Description copied from interface: Manager
      Get an object by id
      Specified by:
      getIfLoaded in interface Manager<I, C, T extends C>
      Parameters:
      id - The id to search by
      Returns:
      a T object if the object is loaded, returns null if the object is not loaded
    • isLoaded

      public boolean isLoaded(I id)
      Description copied from interface: Manager
      Check to see if a object is loaded or not
      Specified by:
      isLoaded in interface Manager<I, C, T extends C>
      Parameters:
      id - The id of the object
      Returns:
      true if the object is loaded
    • unload

      public void unload(I id)
      Description copied from interface: Manager
      Removes and unloads the object from the manager
      Specified by:
      unload in interface Manager<I, C, T extends C>
      Parameters:
      id - The object id to unload
    • retainAll

      public void retainAll(Collection<I> ids)
      Description copied from interface: Manager
      Calls Manager.unload(Object) for all objects currently loaded not in the given collection of ids.
      Specified by:
      retainAll in interface Manager<I, C, T extends C>
      Parameters:
      ids - the ids to retain
    • sanitizeIdentifier

      protected I sanitizeIdentifier(I i)