Package me.hsgamer.hscore.request
Class RequestManager<I,D>
java.lang.Object
me.hsgamer.hscore.request.RequestManager<I,D>
- Type Parameters:
I
- the type of the identifierD
- the type of the data
The generic request manager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddRequest
(I identifier) Add a requestvoid
completeRequest
(I identifier, D data) Complete the request of the identifier.void
completeRequest
(I identifier, D data, boolean handleAll) Complete the request of the identifiervoid
removeRequest
(I identifier) Remove a requestvoid
removeRequests
(I identifier) Remove all requests
-
Constructor Details
-
RequestManager
public RequestManager()
-
-
Method Details
-
addRequest
Add a request- Parameters:
identifier
- the identifier- Returns:
- the data future
-
removeRequests
Remove all requests- Parameters:
identifier
- the identifier
-
removeRequest
Remove a request- Parameters:
identifier
- the identifier
-
completeRequest
Complete the request of the identifier- Parameters:
identifier
- the identifierdata
- the datahandleAll
- if true, all requests will be completed
-
completeRequest
Complete the request of the identifier. This method will handle only one request.- Parameters:
identifier
- the identifierdata
- the data
-