Interface ActionLog
-
public interface ActionLog
A log for allAction
s.- Author:
- Tim Neumann
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Action>
List<T>getActionsOfType(Class<? extends T> type, boolean includeSubclasses)
Get all actions which were logged of the given type.<T extends EntityAction>
List<T>getActionsOfTypeOfEntity(Entity entity, Class<? extends T> type, boolean includeSubclasses)
Get all actions which were logged of the given type and were caused by the given entity.List<Action>
getAllActions()
Get all actions which were logged.List<EntityAction>
getAllActionsOfEntity(Entity entity)
Get all actions which were logged and were caused by the given entity.boolean
getConsoleOutput()
Get ActionLog console output status.void
logAction(Action actionToLog)
Log an action.void
setConsoleOutput(boolean enable)
Set ActionLog console output (default:true
)
-
-
-
Method Detail
-
getAllActions
List<Action> getAllActions()
Get all actions which were logged.Warning: No order is guaranteed.
- Returns:
- A list of all actions logged
-
getActionsOfType
<T extends Action> List<T> getActionsOfType(Class<? extends T> type, boolean includeSubclasses)
Get all actions which were logged of the given type.- Type Parameters:
T
- The generic type to return the actions as- Parameters:
type
- The type of the actions to getincludeSubclasses
- Whether to include the subclasses of the given type- Returns:
- A list of all matching actions
-
getAllActionsOfEntity
List<EntityAction> getAllActionsOfEntity(Entity entity)
Get all actions which were logged and were caused by the given entity.- Parameters:
entity
- The entity to get actions for- Returns:
- A list of all matching actions
-
getActionsOfTypeOfEntity
<T extends EntityAction> List<T> getActionsOfTypeOfEntity(Entity entity, Class<? extends T> type, boolean includeSubclasses)
Get all actions which were logged of the given type and were caused by the given entity.- Type Parameters:
T
- The generic type to return the actions as- Parameters:
entity
- The entity to get actions fortype
- The type of the actions to getincludeSubclasses
- Whether to include the subclasses of the given type- Returns:
- A list of all matching actions
-
logAction
void logAction(Action actionToLog)
Log an action.- Parameters:
actionToLog
- The action to log
-
setConsoleOutput
void setConsoleOutput(boolean enable)
Set ActionLog console output (default:true
)- Parameters:
enable
- true: log to console, false: do not log to console
-
getConsoleOutput
boolean getConsoleOutput()
Get ActionLog console output status.If true
true
, all actions are printed to console when they are logged. Iffalse
the actions are logged but not printed to console.
-
-