-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Info.java
252 lines (208 loc) · 6.34 KB
/
Info.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
package io.swagger.v3.oas.models.info;
import io.swagger.v3.oas.models.annotations.OpenAPI31;
import java.util.Objects;
/**
* @see "https://github.com/OAI/OpenAPI-Specification/blob/3.0.1/versions/3.0.1.md#infoObject"
* @see "https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/versions/3.1.0.md#infoObject"
*/
public class Info {
private String title = null;
private String description = null;
private String termsOfService = null;
private Contact contact = null;
private License license = null;
private String version = null;
private java.util.Map<String, Object> extensions = null;
/**
* @since 2.2.0 (OpenAPI 3.1.0)
*/
@OpenAPI31
private String summary = null;
/**
* returns the title property from a Info instance.
*
* @return String title
**/
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Info title(String title) {
this.title = title;
return this;
}
/**
* returns the description property from a Info instance.
*
* @return String description
**/
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Info description(String description) {
this.description = description;
return this;
}
/**
* returns the termsOfService property from a Info instance.
*
* @return String termsOfService
**/
public String getTermsOfService() {
return termsOfService;
}
public void setTermsOfService(String termsOfService) {
this.termsOfService = termsOfService;
}
public Info termsOfService(String termsOfService) {
this.termsOfService = termsOfService;
return this;
}
/**
* returns the contact property from a Info instance.
*
* @return Contact contact
**/
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public Info contact(Contact contact) {
this.contact = contact;
return this;
}
/**
* returns the license property from a Info instance.
*
* @return License license
**/
public License getLicense() {
return license;
}
public void setLicense(License license) {
this.license = license;
}
public Info license(License license) {
this.license = license;
return this;
}
/**
* returns the version property from a Info instance.
*
* @return String version
**/
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public Info version(String version) {
this.version = version;
return this;
}
/**
* returns the summary property from a Info instance.
*
* @since 2.2.0 (OpenAPI 3.1.0)
* @return String
**/
@OpenAPI31
public String getSummary() {
return summary;
}
/**
* @since 2.2.0 (OpenAPI 3.1.0)
*/
@OpenAPI31
public void setSummary(String summary) {
this.summary = summary;
}
/**
* @since 2.2.0 (OpenAPI 3.1.0)
*/
@OpenAPI31
public Info summary(String summary) {
this.summary = summary;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Info info = (Info) o;
return Objects.equals(this.title, info.title) &&
Objects.equals(this.description, info.description) &&
Objects.equals(this.termsOfService, info.termsOfService) &&
Objects.equals(this.contact, info.contact) &&
Objects.equals(this.license, info.license) &&
Objects.equals(this.version, info.version) &&
Objects.equals(this.extensions, info.extensions) &&
Objects.equals(this.summary, info.summary);
}
@Override
public int hashCode() {
return Objects.hash(title, description, termsOfService, contact, license, version, extensions, summary);
}
public java.util.Map<String, Object> getExtensions() {
return extensions;
}
public void addExtension(String name, Object value) {
if (name == null || name.isEmpty() || !name.startsWith("x-")) {
return;
}
if (this.extensions == null) {
this.extensions = new java.util.LinkedHashMap<>();
}
this.extensions.put(name, value);
}
@OpenAPI31
public void addExtension31(String name, Object value) {
if (name != null && (name.startsWith("x-oas-") || name.startsWith("x-oai-"))) {
return;
}
addExtension(name, value);
}
public void setExtensions(java.util.Map<String, Object> extensions) {
this.extensions = extensions;
}
public Info extensions(java.util.Map<String, Object> extensions) {
this.extensions = extensions;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Info {\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" summary: ").append(toIndentedString(summary)).append("\n");
sb.append(" termsOfService: ").append(toIndentedString(termsOfService)).append("\n");
sb.append(" contact: ").append(toIndentedString(contact)).append("\n");
sb.append(" license: ").append(toIndentedString(license)).append("\n");
sb.append(" version: ").append(toIndentedString(version)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}