Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package io.advantageous.qbit.meta.swagger.builders;
  
  
  import java.util.*;
  
 public class ServiceEndpointInfoBuilder {
 
     private ApiInfoBuilder apiInfoBuilder;

    
Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be "2.0".
 
     private String swagger = "2.0";


    
Required. Provides metadata about the API. The metadata can be used by the clients if needed.
 
     private ApiInfo info;


    
The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the host is not included, the host serving the documentation is to be used (including the port). The host does not support path templating.
 
     private String host;

    
string The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). The basePath does not support path templating.
 
     private String basePath;

    
The transfer protocol of the API. Values MUST be from the list: "http", "https", "ws", "wss". If the schemes is not included, the default scheme to be used is the one used to access the Swagger definition itself.
 
     private List<Stringschemes;

    
A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types.
 
     private List<Stringconsumes;

    
A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under Mime Types.
 
     private List<Stringproduces;

    
Required. The available paths and operations for the API.
 
     private Map<StringPathpaths;
 
 
     private Map<StringDefinitiondefinitions;
 
 
     public Map<StringDefinitiongetDefinitions() {
         if ( == null) {
              = new LinkedHashMap<>();
         }
         return ;
     }
 
     public ServiceEndpointInfoBuilder setDefinitions(Map<StringDefinitiondefinitions) {
         this. = definitions;
         return this;
     }
 
     public ServiceEndpointInfoBuilder addDefinition(final String namefinal Definition definition) {
         getDefinitions().put(namedefinition);
         return this;
     }
 
     public String getSwagger() {
         return ;
     }
 
     public ServiceEndpointInfoBuilder setSwagger(String swagger) {
         this. = swagger;
         return this;
     }
 
     public ApiInfo getInfo() {
         if ( == null) {
              = getApiInfoBuilder().build();
         }
         return ;
     }
 
    public ServiceEndpointInfoBuilder setInfo(ApiInfo info) {
        this. = info;
        return this;
    }
    public String getHost() {
        return ;
    }
    public ServiceEndpointInfoBuilder setHost(String host) {
        this. = host;
        return this;
    }
    public String getBasePath() {
        return ;
    }
    public ServiceEndpointInfoBuilder setBasePath(String basePath) {
        this. = basePath;
        return this;
    }
    public List<StringgetSchemes() {
        if ( == null) {
             = new ArrayList<>();
            .add("http");
            .add("https");
            .add("wss");
            .add("ws");
        }
        return ;
    }
    public ServiceEndpointInfoBuilder setSchemes(List<Stringschemes) {
        this. = schemes;
        return this;
    }
    public List<StringgetConsumes() {
        if ( == null) {
             = new ArrayList<>();
            .add("application/json");
        }
        return ;
    }
    public ServiceEndpointInfoBuilder setConsumes(List<Stringconsumes) {
        this. = consumes;
        return this;
    }
    public List<StringgetProduces() {
        if ( == null) {
             = new ArrayList<>();
            .add("application/json");
        }
        return ;
    }
    public ServiceEndpointInfoBuilder setProduces(List<Stringproduces) {
        this. = produces;
        return this;
    }
    public Map<StringPathgetPaths() {
        if ( == null) {
             = new LinkedHashMap<>();
        }
        return ;
    }
    public ServiceEndpointInfoBuilder addPath(String uriPath path) {
        getPaths().put(uripath);
        return this;
    }
    public ServiceEndpointInfoBuilder setPaths(Map<StringPathpaths) {
        this. = paths;
        return this;
    }
    public ApiInfoBuilder getApiInfoBuilder() {
        if ( == null) {
             = new ApiInfoBuilder();
        }
        return ;
    }
    public void setApiInfoBuilder(ApiInfoBuilder apiInfoBuilder) {
        this. = apiInfoBuilder;
    }
    public ServiceEndpointInfo build() {
        return new ServiceEndpointInfo(getInfo(), getHost(),
                getBasePath(), getPaths(), getSchemes(),
                getConsumes(), getProduces(), getDefinitions());
    }
New to GrepCode? Check out our FAQ X