Merge "Implement basic ShardTransactionChain#CloseTransactionChain"
[controller.git] / opendaylight / md-sal / sal-rest-docgen / src / main / java / org / opendaylight / controller / 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.controller.sal.rest.doc.swagger;
9
10 import java.util.List;
11
12 import org.json.JSONObject;
13
14 /**
15  * Implementation of swagger spec (see <a href=
16  * "https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#52-api-declaration"
17  * > https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#52-api-
18  * declaration</a>)
19  */
20 public class ApiDeclaration {
21     private String apiVersion;
22     private String swaggerVersion;
23     private String basePath;
24     private String resourcePath;
25     private List<String> produces;
26     private List<Api> apis;
27     private JSONObject models;
28
29     public JSONObject getModels() {
30         return models;
31     }
32
33     public void setModels(JSONObject models) {
34         this.models = models;
35     }
36
37     public String getApiVersion() {
38         return apiVersion;
39     }
40
41     public void setApiVersion(String apiVersion) {
42         this.apiVersion = apiVersion;
43     }
44
45     public String getSwaggerVersion() {
46         return swaggerVersion;
47     }
48
49     public void setSwaggerVersion(String swaggerVersion) {
50         this.swaggerVersion = swaggerVersion;
51     }
52
53     public String getBasePath() {
54         return basePath;
55     }
56
57     public void setBasePath(String basePath) {
58         this.basePath = basePath;
59     }
60
61     public String getResourcePath() {
62         return resourcePath;
63     }
64
65     public void setResourcePath(String resourcePath) {
66         this.resourcePath = resourcePath;
67     }
68
69     public List<String> getProduces() {
70         return produces;
71     }
72
73     public void setProduces(List<String> produces) {
74         this.produces = produces;
75     }
76
77     public List<Api> getApis() {
78         return apis;
79     }
80
81     public void setApis(List<Api> apis) {
82         this.apis = apis;
83     }
84
85     public boolean hasApi() {
86         return (apis != null && !apis.isEmpty());
87     }
88
89     public boolean hasModel() {
90         return (models != null && models.length() > 0);
91     }
92 }