Package com.linecorp.armeria.server
Class RoutingResult
java.lang.Object
com.linecorp.armeria.server.RoutingResult
public final class RoutingResult extends Object
The result returned by
Route.apply(RoutingContext)
.-
Method Summary
Modifier and Type Method Description static RoutingResultBuilder
builder()
Returns a new builder.String
decodedPath()
Returns the path mapped by theRoute
, decoded in UTF-8.static RoutingResult
empty()
The emptyRoutingResult
whosetype()
isRoutingResultType.NOT_MATCHED
andisPresent()
returnsfalse
.boolean
hasHighestScore()
Returns whether the score of this result is the highest or not.boolean
hasLowestScore()
Returns whether the score of this result is the lowest or not.boolean
isPresent()
Returnstrue
if this result is notempty()
.MediaType
negotiatedResponseMediaType()
Returns the negotiated producible media type.String
path()
Returns the path mapped by theRoute
.Map<String,String>
pathParams()
Returns the path parameters extracted by theRoute
.String
query()
Returns the query mapped by theRoute
.int
score()
Returns the score of this result.String
toString()
RoutingResultType
type()
Returns the type of this result.
-
Method Details
-
empty
The emptyRoutingResult
whosetype()
isRoutingResultType.NOT_MATCHED
andisPresent()
returnsfalse
. It is returned byRoute.apply(RoutingContext)
when theRoutingContext
did not match the conditions in theRoute
. -
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
-