2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright 2018 TechMahindra
\r
6 *=================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
20 package org.onap.dcaegen2.ves.domain.ves7_0;
\r
22 import java.util.HashMap;
\r
23 import java.util.Map;
\r
24 import com.fasterxml.jackson.annotation.JsonCreator;
\r
25 import com.fasterxml.jackson.annotation.JsonInclude;
\r
26 import com.fasterxml.jackson.annotation.JsonProperty;
\r
27 import com.fasterxml.jackson.annotation.JsonPropertyDescription;
\r
28 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
\r
29 import com.fasterxml.jackson.annotation.JsonValue;
\r
30 import org.apache.commons.lang.builder.EqualsBuilder;
\r
31 import org.apache.commons.lang.builder.HashCodeBuilder;
\r
32 import org.apache.commons.lang.builder.ToStringBuilder;
\r
36 * stateChange fields
\r
39 @JsonInclude(JsonInclude.Include.NON_NULL)
\r
40 @JsonPropertyOrder({
\r
44 "stateChangeFieldsVersion",
\r
47 public class StateChangeFields {
\r
50 * an associative array which is an array of key:value pairs
\r
53 @JsonProperty("additionalFields")
\r
54 @JsonPropertyDescription("an associative array which is an array of key:value pairs")
\r
55 private AlarmAdditionalInformation additionalFields;
\r
57 * new state of the entity
\r
61 @JsonProperty("newState")
\r
62 @JsonPropertyDescription("new state of the entity")
\r
63 private StateChangeFields.NewState newState;
\r
65 * previous state of the entity
\r
69 @JsonProperty("oldState")
\r
70 @JsonPropertyDescription("previous state of the entity")
\r
71 private StateChangeFields.OldState oldState;
\r
73 * version of the stateChangeFields block
\r
77 @JsonProperty("stateChangeFieldsVersion")
\r
78 @JsonPropertyDescription("version of the stateChangeFields block")
\r
79 private StateChangeFields.StateChangeFieldsVersion stateChangeFieldsVersion;
\r
81 * card or port name of the entity that changed state
\r
85 @JsonProperty("stateInterface")
\r
86 @JsonPropertyDescription("card or port name of the entity that changed state")
\r
87 private String stateInterface;
\r
90 * an associative array which is an array of key:value pairs
\r
93 @JsonProperty("additionalFields")
\r
94 public AlarmAdditionalInformation getAdditionalFields() {
\r
95 return additionalFields;
\r
99 * an associative array which is an array of key:value pairs
\r
102 @JsonProperty("additionalFields")
\r
103 public void setAdditionalFields(AlarmAdditionalInformation additionalFields) {
\r
104 this.additionalFields = additionalFields;
\r
108 * new state of the entity
\r
112 @JsonProperty("newState")
\r
113 public StateChangeFields.NewState getNewState() {
\r
118 * new state of the entity
\r
122 @JsonProperty("newState")
\r
123 public void setNewState(StateChangeFields.NewState newState) {
\r
124 this.newState = newState;
\r
128 * previous state of the entity
\r
132 @JsonProperty("oldState")
\r
133 public StateChangeFields.OldState getOldState() {
\r
138 * previous state of the entity
\r
142 @JsonProperty("oldState")
\r
143 public void setOldState(StateChangeFields.OldState oldState) {
\r
144 this.oldState = oldState;
\r
148 * version of the stateChangeFields block
\r
152 @JsonProperty("stateChangeFieldsVersion")
\r
153 public StateChangeFields.StateChangeFieldsVersion getStateChangeFieldsVersion() {
\r
154 return stateChangeFieldsVersion;
\r
158 * version of the stateChangeFields block
\r
162 @JsonProperty("stateChangeFieldsVersion")
\r
163 public void setStateChangeFieldsVersion(StateChangeFields.StateChangeFieldsVersion stateChangeFieldsVersion) {
\r
164 this.stateChangeFieldsVersion = stateChangeFieldsVersion;
\r
168 * card or port name of the entity that changed state
\r
172 @JsonProperty("stateInterface")
\r
173 public String getStateInterface() {
\r
174 return stateInterface;
\r
178 * card or port name of the entity that changed state
\r
182 @JsonProperty("stateInterface")
\r
183 public void setStateInterface(String stateInterface) {
\r
184 this.stateInterface = stateInterface;
\r
188 public String toString() {
\r
189 return ToStringBuilder.reflectionToString(this);
\r
193 public int hashCode() {
\r
194 return new HashCodeBuilder().append(additionalFields).append(newState).append(oldState).append(stateChangeFieldsVersion).append(stateInterface).toHashCode();
\r
198 public boolean equals(Object other) {
\r
199 if (other == this) {
\r
202 if ((other instanceof StateChangeFields) == false) {
\r
205 StateChangeFields rhs = ((StateChangeFields) other);
\r
206 return new EqualsBuilder().append(additionalFields, rhs.additionalFields).append(newState, rhs.newState).append(oldState, rhs.oldState).append(stateChangeFieldsVersion, rhs.stateChangeFieldsVersion).append(stateInterface, rhs.stateInterface).isEquals();
\r
209 public enum NewState {
\r
211 IN_SERVICE("inService"),
\r
212 MAINTENANCE("maintenance"),
\r
213 OUT_OF_SERVICE("outOfService");
\r
214 private final String value;
\r
215 private final static Map<String, StateChangeFields.NewState> CONSTANTS = new HashMap<String, StateChangeFields.NewState>();
\r
218 for (StateChangeFields.NewState c: values()) {
\r
219 CONSTANTS.put(c.value, c);
\r
223 private NewState(String value) {
\r
224 this.value = value;
\r
228 public String toString() {
\r
233 public String value() {
\r
238 public static StateChangeFields.NewState fromValue(String value) {
\r
239 StateChangeFields.NewState constant = CONSTANTS.get(value);
\r
240 if (constant == null) {
\r
241 throw new IllegalArgumentException(value);
\r
249 public enum OldState {
\r
251 IN_SERVICE("inService"),
\r
252 MAINTENANCE("maintenance"),
\r
253 OUT_OF_SERVICE("outOfService");
\r
254 private final String value;
\r
255 private final static Map<String, StateChangeFields.OldState> CONSTANTS = new HashMap<String, StateChangeFields.OldState>();
\r
258 for (StateChangeFields.OldState c: values()) {
\r
259 CONSTANTS.put(c.value, c);
\r
263 private OldState(String value) {
\r
264 this.value = value;
\r
268 public String toString() {
\r
273 public String value() {
\r
278 public static StateChangeFields.OldState fromValue(String value) {
\r
279 StateChangeFields.OldState constant = CONSTANTS.get(value);
\r
280 if (constant == null) {
\r
281 throw new IllegalArgumentException(value);
\r
289 public enum StateChangeFieldsVersion {
\r
292 private final String value;
\r
293 private final static Map<String, StateChangeFields.StateChangeFieldsVersion> CONSTANTS = new HashMap<String, StateChangeFields.StateChangeFieldsVersion>();
\r
296 for (StateChangeFields.StateChangeFieldsVersion c: values()) {
\r
297 CONSTANTS.put(c.value, c);
\r
301 private StateChangeFieldsVersion(String value) {
\r
302 this.value = value;
\r
306 public String toString() {
\r
311 public String value() {
\r
316 public static StateChangeFields.StateChangeFieldsVersion fromValue(String value) {
\r
317 StateChangeFields.StateChangeFieldsVersion constant = CONSTANTS.get(value);
\r
318 if (constant == null) {
\r
319 throw new IllegalArgumentException(value);
\r