Class Route


  • public class Route
    extends java.lang.Object
    Representation of a REST route.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Route.DTO
      Representation of a DTO type.
      static class  Route.Param
      Representation of a parameter of a REST route.
    • Constructor Summary

      Constructors 
      Constructor Description
      Route​(java.lang.String[] paths, RequestMethod[] methods, java.lang.String[] consumes, java.lang.String[] produces, boolean deprecated, Route.DTO returnType, Route.DTO inputType, Route.Param... params)
      The one and only constructor.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • paths

        public final java.lang.String[] paths
        The paths of the endpoint.
      • methods

        public final java.lang.String[] methods
        The supported RequestMethods, as strings.
      • produces

        public final java.lang.String[] produces
        The media types produced by the endpoint. May be null if not specified.
      • consumes

        public final java.lang.String[] consumes
        The media types consumed by the endpoint. May be null if not specified.
      • deprecated

        public final boolean deprecated
        Whether the endpoint is deprecated.
      • returnType

        public final Route.DTO returnType
        A Route.DTO representing the response body.
      • params

        public final Route.Param[] params
        An array of Route.Params, representing parameters accepted by the endpoint.
    • Constructor Detail

      • Route

        public Route​(java.lang.String[] paths,
                     RequestMethod[] methods,
                     java.lang.String[] consumes,
                     java.lang.String[] produces,
                     boolean deprecated,
                     Route.DTO returnType,
                     Route.DTO inputType,
                     Route.Param... params)
        The one and only constructor.
        Parameters:
        paths - the paths of the endpoint
        methods - the RequestMethods accepted by the endpoint
        consumes - the media types consumed by the endpoint, may be null
        produces - the media types produced by the endpoint, may be null
        deprecated - whether the endpoint is deprecated
        returnType - the DTO for the response type, may be null
        inputType - the DTO for the request type, may be null
        params - Route.Params of the endpoint, may be null