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
AEvent
for use with userPermission
objects.- Since:
- 1.4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static EventType<PermissionEvent>
ANY
Common supertype for all permission event types.static EventType<PermissionEvent>
PERMISSION_DISABLED
static EventType<PermissionEvent>
PERMISSION_ENABLED
static EventType<PermissionEvent>
PERMISSIONS_ALL_DISABLED
static EventType<PermissionEvent>
PERMISSIONS_ALL_ENABLED
static 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 newEvent
with the specified event target, type and args.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PermissionEvent
copyFor(java.lang.Object newSource, EventTarget<? extends Event> newTarget)
Creates and returns a copy of this event with the specified event source and target.void
fireEvent(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.Permission
getPermission()
-
-
-
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 newEvent
with 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:Event
Gets the event type of this event. Objects of the sameEvent
class can have different event types. These event types further specify what kind of event occurred.- Overrides:
getEventType
in classEvent
- Returns:
- the event type
-
copyFor
public PermissionEvent copyFor(java.lang.Object newSource, EventTarget<? extends Event> newTarget)
Description copied from class:Event
Creates 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
-
-