Skip to content

Commit 5e8bdc1

Browse files
committed
Slight refacor
1 parent a0c6b73 commit 5e8bdc1

File tree

7 files changed

+369
-267
lines changed

7 files changed

+369
-267
lines changed
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved.
2+
// Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
3+
4+
package oracle.kubernetes.weblogic.domain.v1;
5+
6+
import java.util.ArrayList;
7+
import java.util.List;
8+
import javax.validation.Valid;
9+
import javax.validation.constraints.NotNull;
10+
import com.google.gson.annotations.Expose;
11+
import com.google.gson.annotations.SerializedName;
12+
import org.apache.commons.lang3.builder.EqualsBuilder;
13+
import org.apache.commons.lang3.builder.HashCodeBuilder;
14+
import org.apache.commons.lang3.builder.ToStringBuilder;
15+
import org.joda.time.DateTime;
16+
17+
18+
/**
19+
* ServerHealth describes the current status and health of a specific WebLogic server.
20+
*
21+
*/
22+
public class ServerHealth {
23+
24+
/**
25+
* RFC 3339 date and time at which the server started.
26+
*
27+
*/
28+
@SerializedName("startTime")
29+
@Expose
30+
private DateTime startTime;
31+
/**
32+
* WebLogic cluster name, if the server is part of a cluster
33+
*
34+
*/
35+
@SerializedName("clusterName")
36+
@Expose
37+
private String clusterName;
38+
/**
39+
* Name of node that is hosting the Pod containing this WebLogic server.
40+
*
41+
*/
42+
@SerializedName("nodeName")
43+
@Expose
44+
private String nodeName;
45+
/**
46+
* Current state of this WebLogic server.
47+
* (Required)
48+
*
49+
*/
50+
@SerializedName("state")
51+
@Expose
52+
@NotNull
53+
private String state;
54+
/**
55+
* Server health of this WebLogic server.
56+
*
57+
*/
58+
@SerializedName("health")
59+
@Expose
60+
private String health;
61+
/**
62+
* Name of subsystem providing symptom information.
63+
*
64+
*/
65+
@SerializedName("subsystemName")
66+
@Expose
67+
private String subsystemName;
68+
/**
69+
* Symptoms provided by the reporting subsystem.
70+
*
71+
*/
72+
@SerializedName("symptoms")
73+
@Expose
74+
@Valid
75+
private List<String> symptoms = new ArrayList<String>();
76+
77+
/**
78+
* RFC 3339 date and time at which the server started.
79+
* @return start time
80+
*/
81+
public DateTime getStartTime() {
82+
return startTime;
83+
}
84+
85+
/**
86+
* RFC 3339 date and time at which the server started.
87+
* @param startTime start time
88+
*/
89+
public void setStartTime(DateTime startTime) {
90+
this.startTime = startTime;
91+
}
92+
93+
/**
94+
* RFC 3339 date and time at which the server started.
95+
* @param startTime start time
96+
* @return this
97+
*/
98+
public ServerHealth withStartTime(DateTime startTime) {
99+
this.startTime = startTime;
100+
return this;
101+
}
102+
103+
/**
104+
* WebLogic cluster name, if the server is part of a cluster
105+
* @return cluster name
106+
*/
107+
public String getClusterName() {
108+
return clusterName;
109+
}
110+
111+
/**
112+
* WebLogic cluster name, if the server is part of a cluster
113+
* @param clusterName cluster name
114+
*/
115+
public void setClusterName(String clusterName) {
116+
this.clusterName = clusterName;
117+
}
118+
119+
/**
120+
* WebLogic cluster name, if the server is part of a cluster
121+
* @param clusterName cluster name
122+
* @return this
123+
*/
124+
public ServerHealth withClusterName(String clusterName) {
125+
this.clusterName = clusterName;
126+
return this;
127+
}
128+
129+
/**
130+
* Name of node that is hosting the Pod containing this WebLogic server.
131+
* @return node name
132+
*/
133+
public String getNodeName() {
134+
return nodeName;
135+
}
136+
137+
/**
138+
* Name of node that is hosting the Pod containing this WebLogic server.
139+
* @param nodeName node name
140+
*/
141+
public void setNodeName(String nodeName) {
142+
this.nodeName = nodeName;
143+
}
144+
145+
/**
146+
* Name of node that is hosting the Pod containing this WebLogic server.
147+
* @param nodeName node name
148+
* @return this
149+
*/
150+
public ServerHealth withNodeName(String nodeName) {
151+
this.nodeName = nodeName;
152+
return this;
153+
}
154+
155+
/**
156+
* Current state of this WebLogic server.
157+
* (Required)
158+
* @return state
159+
*/
160+
public String getState() {
161+
return state;
162+
}
163+
164+
/**
165+
* Current state of this WebLogic server.
166+
* (Required)
167+
* @param state state
168+
*/
169+
public void setState(String state) {
170+
this.state = state;
171+
}
172+
173+
/**
174+
* Current state of this WebLogic server.
175+
* (Required)
176+
* @param state state
177+
* @return this
178+
*/
179+
public ServerHealth withState(String state) {
180+
this.state = state;
181+
return this;
182+
}
183+
184+
/**
185+
* Server health of this WebLogic server.
186+
* @return health
187+
*/
188+
public String getHealth() {
189+
return health;
190+
}
191+
192+
/**
193+
* Server health of this WebLogic server.
194+
* @param health health
195+
*/
196+
public void setHealth(String health) {
197+
this.health = health;
198+
}
199+
200+
/**
201+
* Server health of this WebLogic server.
202+
* @param health health
203+
* @return this
204+
*/
205+
public ServerHealth withHealth(String health) {
206+
this.health = health;
207+
return this;
208+
}
209+
210+
/**
211+
* Name of subsystem providing symptom information.
212+
* @return subsystem name
213+
*/
214+
public String getSubsystemName() {
215+
return subsystemName;
216+
}
217+
218+
/**
219+
* Name of subsystem providing symptom information.
220+
* @param subsystemName subsystem name
221+
*/
222+
public void setSubsystemName(String subsystemName) {
223+
this.subsystemName = subsystemName;
224+
}
225+
226+
/**
227+
* Name of subsystem providing symptom information.
228+
* @param subsystemName subsystem name
229+
* @return this
230+
*/
231+
public ServerHealth withSubsystemName(String subsystemName) {
232+
this.subsystemName = subsystemName;
233+
return this;
234+
}
235+
236+
/**
237+
* Symptoms provided by the reporting subsystem.
238+
* @return symptoms
239+
*/
240+
public List<String> getSymptoms() {
241+
return symptoms;
242+
}
243+
244+
/**
245+
* Symptoms provided by the reporting subsystem.
246+
* @param symptoms symptoms
247+
*/
248+
public void setSymptoms(List<String> symptoms) {
249+
this.symptoms = symptoms;
250+
}
251+
252+
/**
253+
* Symptoms provided by the reporting subsystem.
254+
* @param symptoms symptoms
255+
* @return this
256+
*/
257+
public ServerHealth withSymptoms(List<String> symptoms) {
258+
this.symptoms = symptoms;
259+
return this;
260+
}
261+
262+
@Override
263+
public String toString() {
264+
return new ToStringBuilder(this).append("startTime", startTime).append("clusterName", clusterName).append("nodeName", nodeName).append("state", state).append("health", health).append("subsystemName", subsystemName).append("symptoms", symptoms).toString();
265+
}
266+
267+
@Override
268+
public int hashCode() {
269+
return new HashCodeBuilder().append(nodeName).append(symptoms).append(clusterName).append(health).append(startTime).append(state).append(subsystemName).toHashCode();
270+
}
271+
272+
@Override
273+
public boolean equals(Object other) {
274+
if (other == this) {
275+
return true;
276+
}
277+
if ((other instanceof ServerHealth) == false) {
278+
return false;
279+
}
280+
ServerHealth rhs = ((ServerHealth) other);
281+
return new EqualsBuilder().append(nodeName, rhs.nodeName).append(symptoms, rhs.symptoms).append(clusterName, rhs.clusterName).append(health, rhs.health).append(startTime, rhs.startTime).append(state, rhs.state).append(subsystemName, rhs.subsystemName).isEquals();
282+
}
283+
284+
}

0 commit comments

Comments
 (0)