Package com.tnsai.hooks
Record Class HookMatcher.Predicate<E extends HookEvent>
java.lang.Object
java.lang.Record
com.tnsai.hooks.HookMatcher.Predicate<E>
- All Implemented Interfaces:
HookMatcher<E>
- Enclosing interface:
HookMatcher<E extends HookEvent>
public static record HookMatcher.Predicate<E extends HookEvent>(Predicate<E extends HookEvent> test)
extends Record
implements HookMatcher<E>
Arbitrary typed predicate — use when regex-on-eventType isn't
enough (payload field inspection, cross-field rules).
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.hooks.HookMatcher
HookMatcher.All<E extends HookEvent>, HookMatcher.Predicate<E extends HookEvent>, HookMatcher.Regex<E extends HookEvent> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturnstruewhen this matcher should fire forevent.test()Returns the value of thetestrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Predicate
Creates an instance of aPredicaterecord class.- Parameters:
test- the value for thetestrecord component
-
-
Method Details
-
matches
Description copied from interface:HookMatcherReturnstruewhen this matcher should fire forevent.- Specified by:
matchesin interfaceHookMatcher<E extends HookEvent>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
test
Returns the value of thetestrecord component.- Returns:
- the value of the
testrecord component
-