com.jgcomptech.tools.events.PermissionEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-ultimate-tools Show documentation
Show all versions of java-ultimate-tools Show documentation
A large repository of scripts for use in any Java program.
package com.jgcomptech.tools.events;
import com.jgcomptech.tools.authz.Permission;
import java.util.List;
/**
* A {@link Event} for use with user {@link Permission} objects.
* @since 1.4.0
*/
public class PermissionEvent extends Event {
private Permission permission;
public Permission getPermission() { return permission; }
/** Common supertype for all permission event types. */
public static final EventType ANY = new EventType<>(Event.ANY, "PERMISSION");
public static final EventType PERMISSION_ENABLED = ANY.createSubType("PERMISSION_ENABLED");
public static final EventType PERMISSION_DISABLED = ANY.createSubType("PERMISSION_DISABLED");
public static final EventType PERMISSIONS_APPLIED = ANY.createSubType("PERMISSIONS_APPLIED");
public static final EventType PERMISSIONS_ALL_ENABLED =
ANY.createSubType("PERMISSIONS_ALL_ENABLED");
public static final EventType PERMISSIONS_ALL_DISABLED =
ANY.createSubType("PERMISSIONS_ALL_DISABLED");
/**
* Construct a new {@code Event} with the specified event target, type and args.
* @param target the event target to associate with the event
* @param eventType the event type
* @param args arguments to make available to the EventHandler
*/
public PermissionEvent(final EventTarget extends Event> target,
final EventType extends Event> eventType,
final List