Interface Manager<I,C,T extends C>

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 Superinterfaces:
Function<I,T>
All Known Subinterfaces:
GroupManager<T>, TrackManager<T>, UserManager<T>
All Known Implementing Classes:
AbstractGroupManager, AbstractManager, AbstractTrackManager, AbstractUserManager, StandardGroupManager, StandardTrackManager, StandardUserManager

public interface Manager<I,C,T extends C> extends Function<I,T>
A class which manages instances of a class
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets a map containing all cached instances held by this manager.
    Get an object by id
    Gets or creates an object by id
    boolean
    isLoaded(I id)
    Check to see if a object is loaded or not
    void
    Calls unload(Object) for all objects currently loaded not in the given collection of ids.
    void
    unload(I id)
    Removes and unloads the object from the manager

    Methods inherited from interface java.util.function.Function

    andThen, apply, compose
  • Method Details

    • getAll

      Map<I,T> getAll()
      Gets a map containing all cached instances held by this manager.
      Returns:
      all instances held in this manager
    • getOrMake

      T getOrMake(I id)
      Gets or creates an object by id

      Should only every be called by the storage implementation.

      Parameters:
      id - The id to search by
      Returns:
      a Manager object if the object is loaded or makes and returns a new object
    • getIfLoaded

      T getIfLoaded(I id)
      Get an object by id
      Parameters:
      id - The id to search by
      Returns:
      a Manager object if the object is loaded, returns null if the object is not loaded
    • isLoaded

      boolean isLoaded(I id)
      Check to see if a object is loaded or not
      Parameters:
      id - The id of the object
      Returns:
      true if the object is loaded
    • unload

      void unload(I id)
      Removes and unloads the object from the manager
      Parameters:
      id - The object id to unload
    • retainAll

      void retainAll(Collection<I> ids)
      Calls unload(Object) for all objects currently loaded not in the given collection of ids.
      Parameters:
      ids - the ids to retain