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