Interface Manager<I,C,T extends C>
- Type Parameters:
I- the class used to identify each object held in this managerC- the super class being managedT- 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
A class which manages instances of a class
-
Method Summary
Modifier and TypeMethodDescriptiongetAll()Gets a map containing all cached instances held by this manager.getIfLoaded(I id) Get an object by idGets or creates an object by idbooleanCheck to see if a object is loaded or notvoidretainAll(Collection<I> ids) Callsunload(Object)for all objects currently loaded not in the given collection of ids.voidRemoves and unloads the object from the manager
-
Method Details
-
getAll
Gets a map containing all cached instances held by this manager.- Returns:
- all instances held in this manager
-
getOrMake
Gets or creates an object by idShould only every be called by the storage implementation.
- Parameters:
id- The id to search by- Returns:
- a
Managerobject if the object is loaded or makes and returns a new object
-
getIfLoaded
Get an object by id- Parameters:
id- The id to search by- Returns:
- a
Managerobject if the object is loaded, returns null if the object is not loaded
-
isLoaded
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
Removes and unloads the object from the manager- Parameters:
id- The object id to unload
-
retainAll
Callsunload(Object)for all objects currently loaded not in the given collection of ids.- Parameters:
ids- the ids to retain
-