Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package org.bukkit.permissions;
2
3/**
4 * Holds information on a permission and which {@link PermissionAttachment} provides it
5 */
6public class PermissionAttachmentInfo {
7 private final Permissible permissible;
8 private final String permission;
9 private final PermissionAttachment attachment;
10 private final boolean value;
11
12 public PermissionAttachmentInfo(Permissible permissible, String permission, PermissionAttachment attachment, boolean value) {
13 if (permissible == null) {
14 throw new IllegalArgumentException("Permissible may not be null");
15 } else if (permission == null) {
16 throw new IllegalArgumentException("Permissions may not be null");
17 }
18
19 this.permissible = permissible;
20 this.permission = permission;
21 this.attachment = attachment;
22 this.value = value;
23 }
24
25 /**
26 * Gets the permissible this is attached to
27 *
28 * @return Permissible this permission is for
29 */
30 public Permissible getPermissible() {
31 return permissible;
32 }
33
34 /**
35 * Gets the permission being set
36 *
37 * @return Name of the permission
38 */
39 public String getPermission() {
40 return permission;
41 }
42
43 /**
44 * Gets the attachment providing this permission. This may be null for default
45 * permissions (usually parent permissions).
46 *
47 * @return Attachment
48 */
49 public PermissionAttachment getAttachment() {
50 return attachment;
51 }
52
53 /**
54 * Gets the value of this permission
55 *
56 * @return Value of the permission
57 */
58 public boolean getValue() {
59 return value;
60 }
61}