Package com.linecorp.armeria.server
Class RoutingResult
java.lang.Object
com.linecorp.armeria.server.RoutingResult
The result returned by
Route.apply(RoutingContext, boolean)
.-
Method Summary
Modifier and TypeMethodDescriptionstatic RoutingResultBuilder
builder()
Returns a new builder.Returns the path mapped by theRoute
, decoded in UTF-8.static RoutingResult
empty()
The emptyRoutingResult
whosetype()
isRoutingResultType.NOT_MATCHED
andisPresent()
returnsfalse
.static RoutingResult
excluded()
The emptyRoutingResult
whosetype()
isRoutingResultType.NOT_MATCHED
andisPresent()
returnsfalse
.boolean
Returns whether the score of this result is the highest or not.boolean
Returns whether the score of this result is the lowest or not.boolean
Returnstrue
if this result is notempty()
.Returns the negotiated producible media type.path()
Returns the path mapped by theRoute
.Returns the path parameters extracted by theRoute
.query()
Returns the query mapped by theRoute
.int
score()
Returns the score of this result.toString()
type()
Returns the type of this result.
-
Method Details
-
empty
The emptyRoutingResult
whosetype()
isRoutingResultType.NOT_MATCHED
andisPresent()
returnsfalse
. It is returned byRoute.apply(RoutingContext, boolean)
when theRoutingContext
did not match the conditions in theRoute
. -
excluded
The emptyRoutingResult
whosetype()
isRoutingResultType.NOT_MATCHED
andisPresent()
returnsfalse
. It is returned byRoute.apply(RoutingContext, boolean)
when theRoutingContext
is acceptable from one of theexcludedRoutes
. -
builder
Returns a new builder. -
type
Returns the type of this result. -
isPresent
public boolean isPresent()Returnstrue
if this result is notempty()
. -
path
Returns the path mapped by theRoute
.- Throws:
IllegalStateException
- if there's no match
-
decodedPath
Returns the path mapped by theRoute
, decoded in UTF-8.- Throws:
IllegalStateException
- if there's no match
-
query
Returns the query mapped by theRoute
.- Returns:
- the query string, or
null
if there is no query part. - Throws:
IllegalStateException
- if there's no match
-
pathParams
Returns the path parameters extracted by theRoute
.- Throws:
IllegalStateException
- if there's no match
-
score
public int score()Returns the score of this result.Integer.MAX_VALUE
is the highest score of the result, andInteger.MIN_VALUE
is the lowest score of the result. -
hasHighestScore
public boolean hasHighestScore()Returns whether the score of this result is the highest or not. -
hasLowestScore
public boolean hasLowestScore()Returns whether the score of this result is the lowest or not. -
negotiatedResponseMediaType
Returns the negotiated producible media type. -
toString
-