Bug 8351: Enforce check-style rules for restconf - sal-rest-docgen
[netconf.git] / restconf / sal-rest-docgen / src / main / java / org / opendaylight / netconf / sal / rest / doc / swagger / ApiDeclaration.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.sal.rest.doc.swagger;
9
10 import java.util.List;
11 import org.json.JSONObject;
12
13 /**
14  * Implementation of swagger spec (see <a href=
15  * "https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#52-api-declaration"
16  * > https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#52-api-
17  * declaration</a>).
18  */
19 public class ApiDeclaration {
20     private String apiVersion;
21     private String swaggerVersion;
22     private String basePath;
23     private String resourcePath;
24     private List<String> produces;
25     private List<Api> apis;
26     private JSONObject models;
27
28     public JSONObject getModels() {
29         return models;
30     }
31
32     public void setModels(JSONObject models) {
33         this.models = models;
34     }
35
36     public String getApiVersion() {
37         return apiVersion;
38     }
39
40     public void setApiVersion(String apiVersion) {
41         this.apiVersion = apiVersion;
42     }
43
44     public String getSwaggerVersion() {
45         return swaggerVersion;
46     }
47
48     public void setSwaggerVersion(String swaggerVersion) {
49         this.swaggerVersion = swaggerVersion;
50     }
51
52     public String getBasePath() {
53         return basePath;
54     }
55
56     public void setBasePath(String basePath) {
57         this.basePath = basePath;
58     }
59
60     public String getResourcePath() {
61         return resourcePath;
62     }
63
64     public void setResourcePath(String resourcePath) {
65         this.resourcePath = resourcePath;
66     }
67
68     public List<String> getProduces() {
69         return produces;
70     }
71
72     public void setProduces(List<String> produces) {
73         this.produces = produces;
74     }
75
76     public List<Api> getApis() {
77         return apis;
78     }
79
80     public void setApis(List<Api> apis) {
81         this.apis = apis;
82     }
83
84     public boolean hasApi() {
85         return (apis != null && !apis.isEmpty());
86     }
87
88     public boolean hasModel() {
89         return (models != null && models.length() > 0);
90     }
91 }