Record Class FromMatcher.PredicateBased
java.lang.Object
java.lang.Record
io.axoniq.framework.messaging.transformation.FromMatcher.PredicateBased
- Record Components:
predicate- the source predicatedeclaredFromTypes- the qualified names the predicate is restricted to; empty means every candidate
- All Implemented Interfaces:
FromMatcher
- Enclosing interface:
FromMatcher
public static record FromMatcher.PredicateBased(Predicate<MessageType> predicate, Set<QualifiedName> declaredFromTypes)
extends Record
implements FromMatcher
Predicate-source matcher: matches any
MessageType the predicate accepts. When
declaredFromTypes is non-empty it acts as a pre-filter: only events whose
MessageType.qualifiedName() is one of those names ever reach the predicate. An empty
set evaluates the predicate against every candidate.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.axoniq.framework.messaging.transformation.FromMatcher
FromMatcher.Exact, FromMatcher.PredicateBased -
Constructor Summary
ConstructorsConstructorDescriptionPredicateBased(Predicate<MessageType> predicate, Set<QualifiedName> declaredFromTypes) Creates an instance of aPredicateBasedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedeclaredFromTypesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(MessageType candidate) Answers whether the givencandidatetype satisfies this matcher.Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PredicateBased
Creates an instance of aPredicateBasedrecord class.- Parameters:
predicate- the value for thepredicaterecord componentdeclaredFromTypes- the value for thedeclaredFromTypesrecord component
-
-
Method Details
-
matches
Description copied from interface:FromMatcherAnswers whether the givencandidatetype satisfies this matcher.- Specified by:
matchesin interfaceFromMatcher- Parameters:
candidate- the message'sMessageType- Returns:
truewhen the candidate matches
-
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). -
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
declaredFromTypes
Returns the value of thedeclaredFromTypesrecord component.- Returns:
- the value of the
declaredFromTypesrecord component
-