Interface AnnotatedService
- All Superinterfaces:
HttpService
,Service<HttpRequest,
,HttpResponse> Unwrappable
An
HttpService
which is defined by a Path
or HTTP method annotations.
This class is designed to provide a common interface and expose as public for Annotated HTTP Service.
Please check out the documentation at
Annotated HTTP Service to use this.-
Method Summary
Modifier and TypeMethodDescriptionReturns the defaultHttpStatus
specified withStatusCode
.method()
Returns the targetMethod
invoked when a request is received.default String
Returns the name of the target method invoked when a request is received.name()
Returns the name of this annotated service specified withServiceName
.route()
Returns theRoute
for thisAnnotatedService
.Class
<?> Returns theClass
of the annotated service object specified withServerBuilder.annotatedService(Object)
.Returns the annotated service object specified withServerBuilder.annotatedService(Object)
.Methods inherited from interface com.linecorp.armeria.server.HttpService
decorate, decorate, exchangeType, options, serve
Methods inherited from interface com.linecorp.armeria.server.Service
as, serviceAdded, shouldCachePath, unwrap
Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable
equalsIgnoreWrapper, unwrapAll
-
Method Details
-
name
Returns the name of this annotated service specified withServiceName
. -
serviceObject
Object serviceObject()Returns the annotated service object specified withServerBuilder.annotatedService(Object)
. -
serviceClass
Class<?> serviceClass()Returns theClass
of the annotated service object specified withServerBuilder.annotatedService(Object)
. -
method
Method method()Returns the targetMethod
invoked when a request is received. -
methodName
Returns the name of the target method invoked when a request is received. -
route
Route route()Returns theRoute
for thisAnnotatedService
. -
defaultStatus
HttpStatus defaultStatus()Returns the defaultHttpStatus
specified withStatusCode
. IfStatusCode
is not given,HttpStatus.OK
is returned by default. If the method returns a void type such asVoid
or Kotlin Unit,HttpStatus.NO_CONTENT
is returned.
-