Class StringRequestConverterFunction
java.lang.Object
com.linecorp.armeria.server.annotation.StringRequestConverterFunction
- All Implemented Interfaces:
RequestConverterFunction
public final class StringRequestConverterFunction
extends Object
implements RequestConverterFunction
A
RequestConverterFunction
which converts a text body of the
AggregatedHttpRequest
to a String
.
Note that this RequestConverterFunction
is applied to an annotated service by default,
so you don't have to specify this converter explicitly.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertRequest
(ServiceRequestContext ctx, AggregatedHttpRequest request, Class<?> expectedResultType, @Nullable ParameterizedType expectedParameterizedResultType) Converts the specifiedAggregatedHttpRequest
to aString
.
-
Constructor Details
-
StringRequestConverterFunction
public StringRequestConverterFunction()
-
-
Method Details
-
convertRequest
public Object convertRequest(ServiceRequestContext ctx, AggregatedHttpRequest request, Class<?> expectedResultType, @Nullable @Nullable ParameterizedType expectedParameterizedResultType) throws Exception Converts the specifiedAggregatedHttpRequest
to aString
.- Specified by:
convertRequest
in interfaceRequestConverterFunction
- Parameters:
ctx
- theServiceRequestContext
ofrequest
.request
- theAggregatedHttpRequest
being handled.expectedResultType
- the desired type of the conversion result.expectedParameterizedResultType
- the desired parameterized type of the conversion result.null
will be given ifexpectedResultType
doesn't have any type parameters.- Throws:
Exception
-