All Superinterfaces:
HttpAnnotated, ModelElement, Prototype.Api
All Known Implementing Classes:
RestMethod.BuilderBase.RestMethodImpl

public interface RestMethod extends Prototype.Api, HttpAnnotated, ModelElement
Definition of a rest method. Rest method is a method on an interface or a class annotation with HTTP method annotation.
See Also:
  • Method Details

    • builder

      static RestMethod.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static RestMethod.Builder builder(RestMethod instance)
      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
    • create

      static RestMethod create()
      Create a new instance with default values.
      Returns:
      a new instance
    • status

      Optional<HttpStatus> status()
      HTTP Status (server side only) annotation on the method.
      Returns:
      status to return
    • returnType

      TypeName returnType()
      Type returned by this method.
      Returns:
      return type of the method
    • name

      String name()
      Method name.
      Returns:
      name of the method
    • 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

      HttpMethod httpMethod()
      HTTP method of this method.
      Returns:
      HTTP method
    • parameters

      List<RestMethodParameter> parameters()
      All parameters of this method.
      Returns:
      method 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

      List<RestMethodParameter> pathParameters()
      Path parameters (if defined).
      Returns:
      path parameters
    • method

      Method element info.
      Returns:
      method element info
    • type

      TypeInfo type()
      Owning type info.
      Returns:
      type info