diff --git a/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java b/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java index ea6a99e5..948fe2fa 100644 --- a/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/NodeMap.java @@ -57,7 +57,11 @@ import javax.annotation.Nullable; /** * A map of nodes held by a {@link PermissionHolder}. * - * Each holder has two of these maps, one for enduring and transient nodes. + *
Permissions are stored in Multimaps, with the context of the node being the key, and the actual Node object being + * the value. The keys (context sets) are ordered according to their weight {@link ContextSetComparator}, and the values + * are ordered according to the priority of the node, according to {@link NodeComparator}.
+ * + *Each holder has two of these maps, one for enduring and transient nodes.
*/ public final class NodeMap { diff --git a/common/src/main/java/me/lucko/luckperms/common/model/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/common/model/PermissionHolder.java index e3dcddf6..27c64a8b 100644 --- a/common/src/main/java/me/lucko/luckperms/common/model/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/model/PermissionHolder.java @@ -44,11 +44,9 @@ import me.lucko.luckperms.common.caching.HolderCachedData; import me.lucko.luckperms.common.caching.handlers.StateListener; import me.lucko.luckperms.common.caching.type.MetaAccumulator; import me.lucko.luckperms.common.config.ConfigKeys; -import me.lucko.luckperms.common.contexts.ContextSetComparator; import me.lucko.luckperms.common.node.ImmutableLocalizedNode; import me.lucko.luckperms.common.node.InheritanceInfo; import me.lucko.luckperms.common.node.MetaType; -import me.lucko.luckperms.common.node.NodeComparator; import me.lucko.luckperms.common.node.NodeFactory; import me.lucko.luckperms.common.node.NodeTools; import me.lucko.luckperms.common.node.NodeWithContextComparator; @@ -79,63 +77,74 @@ import java.util.stream.Collectors; /** * Represents an object that can hold permissions, (a user or group) * - *Permissions are stored in Multimaps, with the context of the node being the key, and the actual Node object being - * the value. The keys (context sets) are ordered according to their weight {@link ContextSetComparator}, and the values - * are ordered according to the priority of the node, according to {@link NodeComparator}.
+ *Data is stored in {@link NodeMap}s. A holder has two of these, one for + * enduring nodes and one for transient nodes.
* - *This class also provides a number of methods to perform inheritance lookups. These lookup methods initially use - * Lists of nodes populated with the inheritance tree. Nodes at the start of this list have priority over nodes at the - * end. Nodes higher up the tree appear at the end of these lists. In order to remove duplicate elements, the lists are - * flattened using the methods in {@link NodeTools}. This is significantly faster than trying to prevent duplicates - * throughout the process of accumulation, and reduces the need for too much caching.
+ *This class provides a number of methods to perform inheritance lookups. + * These lookup methods initially use Lists of nodes populated with the + * inheritance tree. Nodes at the start of this list have priority over nodes at + * the end. Nodes higher up the tree appear at the end of these lists. In order + * to remove duplicate elements, the lists are flattened using the methods in + * {@link NodeTools}. This is significantly faster than trying to prevent + * duplicates throughout the process of accumulation, and reduces the need for + * too much caching.
* - *Cached state is avoided in these instances to cut down on memory footprint. The nodes are stored indexed to the - * contexts they apply in, so doing context specific querying should be fast. Caching would be ineffective here, due to - * the potentially vast amount of contexts being used by nodes, and the potential for very large inheritance trees.
+ *Cached state is avoided in these instances to cut down on memory + * footprint. The nodes are stored indexed to the contexts they apply in, so + * doing context specific querying should be fast. Caching would be ineffective + * here, due to the potentially vast amount of contexts being used by nodes, + * and the potential for very large inheritance trees.
*/ public abstract class PermissionHolder { /** - * The name of this PermissionHolder object. + * The name of this object. * - *Used to prevent circular inheritance issues.
+ *Used as a base for identifying permission holding objects. Also acts + * as a method for preventing circular inheritance issues.
* - *For users, this value is a String representation of their {@link User#getUuid()}. For groups, it's just the - * {@link Group#getName()}.
+ * @see User#getUuid() + * @see Group#getName() + * @see #getObjectName() */ private final String objectName; /** * Reference to the main plugin instance + * @see #getPlugin() */ private final LuckPermsPlugin plugin; /** * The holders persistent nodes. + * + *These (unlike transient nodes) are saved to the storage backing.
+ * + * @see #getEnduringData() */ private final NodeMap enduringNodes = new NodeMap(this); /** * The holders transient nodes. * - *These are nodes which are never stored or persisted to a file, and only - * last until the end of the objects lifetime. (for a group, that's when the server stops, and for a user, it's when - * they log out, or get unloaded.)
+ *These are nodes which are never stored or persisted to a file, and + * only last until the end of the objects lifetime. (for a group, that's + * when the server stops, and for a user, it's when they log out, or get + * unloaded.)
+ * + * @see #getTransientData() */ private final NodeMap transientNodes = new NodeMap(this); /** - * Caches the holders weight lookup + * Caches the holders weight + * @see #getWeight() */ - private final Cache