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
Modifier and TypeClassDescription(package private) static class
A parsed routing target that can have null target and key values.static class
An intermediary to ultimately createRoutingTarget
instances. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Creates a newRoutingTarget.RoutingTargetBuilder
for the given target.getKey()
Returns the routing key.Returns the routing target.int
hashCode()
boolean
Returns whether the routing key is a SpEL expression.(package private) static RoutingTarget.ParsedRoutingTarget
Creates a newRoutingTarget.ParsedRoutingTarget
by parsing the given source.toString()
(package private) RoutingTarget
verify()
(package private) RoutingTarget
Creates a newRoutingTarget
with the same target but the given routing key.(package private) RoutingTarget
withTarget
(String target)
-
Method Details
-
parse
Creates a newRoutingTarget.ParsedRoutingTarget
by parsing the given source.- Parameters:
source
- must not be null.- Returns:
- will never be null.
-
forTarget
Creates a newRoutingTarget.RoutingTargetBuilder
for 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.
-
withTarget
-
withKey
Creates a newRoutingTarget
with 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()
-