Class ProtocolDescription<T>

java.lang.Object
com.codingchili.core.protocol.ProtocolDescription<T>

public class ProtocolDescription<T> extends Object
Contains protocol mappings and descriptions.
  • Constructor Details

    • ProtocolDescription

      public ProtocolDescription()
  • Method Details

    • setTemplate

      public ProtocolDescription<T> setTemplate(Class<?> template)
      Parameters:
      template - the class template to use as a base for all requests.
      Returns:
      fluent
    • getModel

      public Map<String,​String> getModel()
      Returns:
      the base template to be used by all requests to this api, authentication etc.
    • setModel

      public ProtocolDescription setModel(Map<String,​String> model)
      Parameters:
      model - the template described as a serialized model with Serializer.describe(Class)
      Returns:
      fluent
    • getDescription

      public String getDescription()
      Returns:
      a description of the api.
    • setDescription

      public ProtocolDescription<T> setDescription(String description)
      Parameters:
      description - the description of the api.
      Returns:
      fluent
    • getRoutes

      public Map<String,​Route<T>> getRoutes()
      Returns:
      a map of routes that are available on the endpoint.
    • setRoutes

      public ProtocolDescription<T> setRoutes(List<Route<T>> routes)
      Parameters:
      routes - a list of routes to be included in the generated api documentation.
      Returns:
      fluent
    • setRoutes

      public ProtocolDescription<T> setRoutes(Map<String,​Route<T>> routes)
      Parameters:
      routes - a map of routes to be included in the generated api documentation.
      Returns:
      fluent
    • addRoute

      public ProtocolDescription<T> addRoute(Route<T> route)
      Parameters:
      route - a route to be included in the protocol description.
      Returns:
      fluent
    • getTarget

      public String getTarget()
      Returns:
      the endpoint (target) at which this api is mounted.
    • setTarget

      public ProtocolDescription<T> setTarget(String target)
      Parameters:
      target - the target node at which this api is available.
      Returns:
      fluent