Package com.jgcomptech.tools.events
Class PermissionEvent
- java.lang.Object
-
- com.jgcomptech.tools.events.Event
-
- com.jgcomptech.tools.events.PermissionEvent
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class PermissionEvent extends Event
AEventfor use with userPermissionobjects.- Since:
- 1.4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static EventType<PermissionEvent>ANYCommon supertype for all permission event types.static EventType<PermissionEvent>PERMISSION_DISABLEDstatic EventType<PermissionEvent>PERMISSION_ENABLEDstatic EventType<PermissionEvent>PERMISSIONS_ALL_DISABLEDstatic EventType<PermissionEvent>PERMISSIONS_ALL_ENABLEDstatic EventType<PermissionEvent>PERMISSIONS_APPLIED
-
Constructor Summary
Constructors Constructor Description PermissionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType, java.util.List<java.lang.Object> args)Construct a newEventwith the specified event target, type and args.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PermissionEventcopyFor(java.lang.Object newSource, EventTarget<? extends Event> newTarget)Creates and returns a copy of this event with the specified event source and target.voidfireEvent(java.lang.Object source, Permission permission)Fires the event with the specified source and permission.EventType<? extends PermissionEvent>getEventType()Gets the event type of this event.PermissiongetPermission()
-
-
-
Field Detail
-
ANY
public static final EventType<PermissionEvent> ANY
Common supertype for all permission event types.
-
PERMISSION_ENABLED
public static final EventType<PermissionEvent> PERMISSION_ENABLED
-
PERMISSION_DISABLED
public static final EventType<PermissionEvent> PERMISSION_DISABLED
-
PERMISSIONS_APPLIED
public static final EventType<PermissionEvent> PERMISSIONS_APPLIED
-
PERMISSIONS_ALL_ENABLED
public static final EventType<PermissionEvent> PERMISSIONS_ALL_ENABLED
-
PERMISSIONS_ALL_DISABLED
public static final EventType<PermissionEvent> PERMISSIONS_ALL_DISABLED
-
-
Constructor Detail
-
PermissionEvent
public PermissionEvent(EventTarget<? extends Event> target, EventType<? extends Event> eventType, java.util.List<java.lang.Object> args)
Construct a newEventwith the specified event target, type and args.- Parameters:
target- the event target to associate with the eventeventType- the event typeargs- arguments to make available to the EventHandler
-
-
Method Detail
-
getPermission
public Permission getPermission()
-
getEventType
public EventType<? extends PermissionEvent> getEventType()
Description copied from class:EventGets the event type of this event. Objects of the sameEventclass can have different event types. These event types further specify what kind of event occurred.- Overrides:
getEventTypein classEvent- Returns:
- the event type
-
copyFor
public PermissionEvent copyFor(java.lang.Object newSource, EventTarget<? extends Event> newTarget)
Description copied from class:EventCreates and returns a copy of this event with the specified event source and target.
-
fireEvent
public void fireEvent(java.lang.Object source, Permission permission)Fires the event with the specified source and permission.- Parameters:
source- the event source which sent the eventpermission- the permission object to pass to the EventHandler
-
-