Class RoutingTarget
java.lang.Object
org.springframework.modulith.events.RoutingTarget
A
String-based routing target that supports a :: delimiter to separate the sole target from an
additional key. The key itself could be of any format and might be subject for deeper inspection downstream.- Since:
- 1.1
- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classA parsed routing target that can have null target and key values.static classAn intermediary to ultimately createRoutingTargetinstances. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCreates a newRoutingTarget.RoutingTargetBuilderfor the given target.getKey()Returns the routing key.Returns the routing target.booleanReturns whether either the target or key is using a SpEL expression.inthashCode()booleanReturns whether the routing key is a SpEL expression.(package private) static RoutingTarget.ParsedRoutingTargetCreates a newRoutingTarget.ParsedRoutingTargetby parsing the given source.toString()(package private) RoutingTargetverify()(package private) RoutingTargetCreates a newRoutingTargetwith the same target but the given routing key.(package private) RoutingTargetwithTarget(String target)
-
Method Details
-
parse
Creates a newRoutingTarget.ParsedRoutingTargetby parsing the given source.- Parameters:
source- must not be null.- Returns:
- will never be null.
-
forTarget
Creates a newRoutingTarget.RoutingTargetBuilderfor the given target.- Parameters:
target- must not be null or empty.- Returns:
- will never be null.
-
getTarget
Returns the routing target.- Returns:
- will never be null.
-
getKey
Returns the routing key.- Returns:
- can be null.
-
hasKeyExpression
public boolean hasKeyExpression()Returns whether the routing key is a SpEL expression.- Returns:
- whether the routing key is a SpEL expression.
-
hasExpression
public boolean hasExpression()Returns whether either the target or key is using a SpEL expression.- Returns:
- whether the routing key is a SpEL expression.
- Since:
- 1.3
-
withTarget
-
withKey
Creates a newRoutingTargetwith the same target but the given routing key.- Parameters:
key- can be null.- Returns:
- will never be null.
-
verify
RoutingTarget verify() -
toString
-
equals
-
hashCode
public int hashCode()
-