Interface RestMethod
- All Superinterfaces:
HttpAnnotated, ModelElement, Prototype.Api
- All Known Implementing Classes:
RestMethod.BuilderBase.RestMethodImpl
Definition of a rest method.
Rest method is a method on an interface or a class annotation with HTTP method annotation.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forRestMethod.static classRestMethod.BuilderBase<BUILDER extends RestMethod.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends RestMethod>Fluent API builder base forRestMethod. -
Method Summary
Modifier and TypeMethodDescriptionstatic RestMethod.Builderbuilder()Create a new fluent API builder to customize configuration.static RestMethod.Builderbuilder(RestMethod instance) Create a new fluent API builder from an existing instance.Entity parameter (if defined).Header parameters (if defined).HTTP method of this method.method()Method element info.name()Method name.All parameters of this method.Path parameters (if defined).Query parameters (if defined).Type returned by this method.status()HTTP Status (server side only) annotation on the method.type()Owning type info.Unique name of the method (used for generated code).Methods inherited from interface HttpAnnotated
computedHeaders, consumes, headers, path, producesModifier and TypeMethodDescriptionList of computed header values.consumes()List of consumed media types (from server endpoint point of view).headers()List of configured header values.path()Path of the endpoint/method (optional).produces()List of produced media types (from server endpoint point of view).Methods inherited from interface ModelElement
annotations, typeModifier and TypeMethodDescriptionAll annotations on this element, and inherited from supertype/interface and annotations.type()Type of this element.
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
status
Optional<HttpStatus> status()HTTP Status (server side only) annotation on the method.- Returns:
- status to return
-
returnType
-
name
-
uniqueName
String uniqueName()Unique name of the method (used for generated code). If there is more than one method with the same name within a type, the second (and further) methods will have an index based unique name generated.- Returns:
- unique name of this method for generated code
-
httpMethod
-
parameters
-
entityParameter
Optional<RestMethodParameter> entityParameter()Entity parameter (if defined).- Returns:
- method entity parameter
-
headerParameters
List<RestMethodParameter> headerParameters()Header parameters (if defined).- Returns:
- header parameters
-
queryParameters
List<RestMethodParameter> queryParameters()Query parameters (if defined).- Returns:
- query parameters
-
pathParameters
-
method
-
type
-