-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Server.java
152 lines (124 loc) · 3.91 KB
/
Server.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
package io.swagger.v3.oas.models.servers;
import io.swagger.v3.oas.models.annotations.OpenAPI31;
import java.util.Objects;
/**
* Server
*
* @see "https://github.com/OAI/OpenAPI-Specification/blob/3.0.1/versions/3.0.1.md#serverObject"
* @see "https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/versions/3.1.0.md#serverObject"
*/
public class Server {
private String url = null;
private String description = null;
private ServerVariables variables = null;
private java.util.Map<String, Object> extensions = null;
/**
* returns the url property from a Server instance.
*
* @return String url
**/
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public Server url(String url) {
this.url = url;
return this;
}
/**
* returns the description property from a Server instance.
*
* @return String description
**/
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Server description(String description) {
this.description = description;
return this;
}
/**
* returns the variables property from a Server instance.
*
* @return ServerVariables variables
**/
public ServerVariables getVariables() {
return variables;
}
public void setVariables(ServerVariables variables) {
this.variables = variables;
}
public Server variables(ServerVariables variables) {
this.variables = variables;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Server server = (Server) o;
return Objects.equals(this.url, server.url) &&
Objects.equals(this.description, server.description) &&
Objects.equals(this.variables, server.variables) &&
Objects.equals(this.extensions, server.extensions);
}
@Override
public int hashCode() {
return Objects.hash(url, description, variables, extensions);
}
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 Server extensions(java.util.Map<String, Object> extensions) {
this.extensions = extensions;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Server {\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" variables: ").append(toIndentedString(variables)).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 ");
}
}