Package net.luckperms.api.node.matcher
Interface NodeMatcherFactory
-
@Internal public interface NodeMatcherFactory
A factory which createsNodeMatchers.- Since:
- 5.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Node>
@NonNull NodeMatcher<T>equals(@NonNull T other, @NonNull NodeEqualityPredicate equalityPredicate)Gets aNodeMatcherwhich matches nodes which areequal tothe givenothernode according to theNodeEqualityPredicate.@NonNull NodeMatcher<Node>key(@NonNull String key)Gets aNodeMatcherwhich matches nodes with the samekey.<T extends Node>
@NonNull NodeMatcher<T>key(@NonNull T node)Gets aNodeMatcherwhich matches nodes with the samekey.@NonNull NodeMatcher<Node>keyStartsWith(@NonNull String startingWith)Gets aNodeMatcherwhich matches nodes with akeystarting with the given string.@NonNull NodeMatcher<MetaNode>metaKey(@NonNull String metaKey)<T extends Node>
@NonNull NodeMatcher<T>type(NodeType<? extends T> type)
-
-
-
Method Detail
-
key
@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.Prefer using the
NodeMatcher.key(String)accessor.- Parameters:
key- the key- Returns:
- the matcher
-
key
<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.Prefer using the
NodeMatcher.key(Node)accessor.- Type Parameters:
T- the node type- Parameters:
node- the node to use for the key- Returns:
- the matcher
-
keyStartsWith
@NonNull NodeMatcher<Node> keyStartsWith(@NonNull String startingWith)
Gets aNodeMatcherwhich matches nodes with akeystarting with the given string.Prefer using the
NodeMatcher.keyStartsWith(String)accessor.- Parameters:
startingWith- the string to match- Returns:
- the matcher
-
equals
<T extends Node> @NonNull NodeMatcher<T> equals(@NonNull T other, @NonNull NodeEqualityPredicate equalityPredicate)
Gets aNodeMatcherwhich matches nodes which areequal tothe givenothernode according to theNodeEqualityPredicate.Prefer using the
NodeMatcher.equals(Node, NodeEqualityPredicate)accessor.- Type Parameters:
T- the node type- Parameters:
other- the other node to test againstequalityPredicate- the equality predicate- Returns:
- the matcher
-
metaKey
@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.Prefer using the
NodeMatcher.metaKey(String)accessor.- Parameters:
metaKey- the meta key- Returns:
- the matcher
-
type
<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.Prefer using the
NodeMatcher.type(NodeType)accessor.- Type Parameters:
T- the node type- Parameters:
type- the node type- Returns:
- the matcher
-
-