Record Class HandlerMethodPreparation<M>
java.lang.Object
java.lang.Record
io.fluxzero.common.handling.HandlerMethodPreparation<M>
- Type Parameters:
M- the message type used by the handling pipeline- Record Components:
status- the outcome of the preparationplan- the reusable invocation plan whenstatusisHandlerMethodPreparation.Status.PREPARED; otherwisenull
public record HandlerMethodPreparation<M>(HandlerMethodPreparation.Status status, HandlerMethodPlan<M> plan)
extends Record
The outcome of trying to prepare a handler method for repeated invocation.
A preparation distinguishes a successful match, a definitive non-match, and a case that cannot be prepared safely. This distinction lets callers cache non-matches while retaining the normal handling path for unsupported cases.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPossible outcomes of preparing a handler method. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aHandlerMethodPreparationrecord class. -
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.booleanReturns whether preparation produced an invocation plan.booleanReturns whether the normal per-message handling path must be used.static <M> HandlerMethodPreparation<M> noMatch()plan()Returns the value of theplanrecord component.static <M> HandlerMethodPreparation<M> prepared(HandlerMethodPlan<M> plan) Creates a successful preparation.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.static <M> HandlerMethodPreparation<M>
-
Constructor Details
-
Method Details
-
prepared
Creates a successful preparation.- Parameters:
plan- the reusable invocation plan- Returns:
- a successful preparation containing the plan
-
noMatch
-
unsupported
-
isPrepared
public boolean isPrepared()Returns whether preparation produced an invocation plan.- Returns:
truewhenplan()can be invoked
-
isUnsupported
public boolean isUnsupported()Returns whether the normal per-message handling path must be used.- Returns:
truewhen safe preparation was not possible
-
toString
-
hashCode
-
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). -
status
-
plan
-