Package net.luckperms.api.node.matcher
Interface NodeMatcher<T extends Node>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T extends Node>
@NonNull NodeMatcher<T>equals(@NonNull T other, @NonNull NodeEqualityPredicate equalityPredicate)Gets aNodeMatcherwhich matches nodes which areequal tothe givenothernode according to theNodeEqualityPredicate.static @NonNull NodeMatcher<Node>key(@NonNull String key)Gets aNodeMatcherwhich matches nodes with the samekey.static <T extends Node>
@NonNull NodeMatcher<T>key(@NonNull T node)Gets aNodeMatcherwhich matches nodes with the samekey.static @NonNull NodeMatcher<Node>keyStartsWith(@NonNull String startingWith)Gets aNodeMatcherwhich matches nodes with akeystarting with the given string.static @NonNull NodeMatcher<MetaNode>metaKey(@NonNull String metaKey)static @NonNull NodeMatcher<MetaNode>metaKey(@NonNull MetaNode metaNode)booleantest(@NonNull Node node)Tests to see if the givenNodematches.static <T extends Node>
@NonNull NodeMatcher<T>type(NodeType<? extends T> type)
-
-
-
Method Detail
-
key
static @NonNull NodeMatcher<Node> key(@NonNull String key)
Gets aNodeMatcherwhich matches nodes with the samekey.The
String.equalsIgnoreCase(String)method is used to test key equality.- Parameters:
key- the key- Returns:
- the matcher
-
key
static <T extends Node> @NonNull NodeMatcher<T> key(@NonNull T node)
Gets aNodeMatcherwhich matches nodes with the samekey.The
String.equalsIgnoreCase(String)method is used to test key equality.- Type Parameters:
T- the node type- Parameters:
node- the node to use for the key- Returns:
- the matcher
-
keyStartsWith
static @NonNull NodeMatcher<Node> keyStartsWith(@NonNull String startingWith)
Gets aNodeMatcherwhich matches nodes with akeystarting with the given string.- Parameters:
startingWith- the string to match- Returns:
- the matcher
-
equals
static <T extends Node> @NonNull NodeMatcher<T> equals(@NonNull T other, @NonNull NodeEqualityPredicate equalityPredicate)
Gets aNodeMatcherwhich matches nodes which areequal tothe givenothernode according to theNodeEqualityPredicate.- Type Parameters:
T- the node type- Parameters:
other- the other node to test againstequalityPredicate- the equality predicate- Returns:
- the matcher
-
metaKey
static @NonNull NodeMatcher<MetaNode> metaKey(@NonNull String metaKey)
Gets aNodeMatcherwhich matchesMetaNodes with the samemeta key.The
String.equalsIgnoreCase(String)method is used to test key equality.- Parameters:
metaKey- the meta key- Returns:
- the matcher
-
metaKey
static @NonNull NodeMatcher<MetaNode> metaKey(@NonNull MetaNode metaNode)
Gets aNodeMatcherwhich matchesMetaNodes with the samemeta key.The
String.equalsIgnoreCase(String)method is used to test key equality.- Parameters:
metaNode- the meta node to use for the meta key- Returns:
- the matcher
-
type
static <T extends Node> @NonNull NodeMatcher<T> type(NodeType<? extends T> type)
Gets aNodeMatcherwhich matchesNodes with the same type as the givenNodeType.NodeType.PERMISSION,NodeType.CHAT_METAandNodeType.META_OR_CHAT_METAare not supported by this method.- Type Parameters:
T- the node type- Parameters:
type- the node type- Returns:
- the matcher
-
-