diff options
author | Rashmi Pujar <rashmi.pujar@bell.ca> | 2019-11-05 17:10:00 -0500 |
---|---|---|
committer | Rashmi Pujar <rashmi.pujar@bell.ca> | 2019-11-07 17:03:48 -0500 |
commit | 3d372e317bff5fe7e27296cab4ed76e759f86994 (patch) | |
tree | 2fef62b9ab7712dff5eea8a227589b7ccc670694 /models-interactions/model-impl/events/src/main | |
parent | d7fcb9802900c2ce2abacb4f7e01713cdd7ba663 (diff) |
Use lombok annotations for objects in models-interaction/models-impl module
Issue-ID: POLICY-1896
Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca>
Change-Id: I425afe25876cea91908391418582ef584e6fe6fc
Diffstat (limited to 'models-interactions/model-impl/events/src/main')
8 files changed, 46 insertions, 371 deletions
diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java index 3ff7aa256..bbe902ac2 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopEvent.java @@ -25,11 +25,11 @@ import com.google.gson.annotations.SerializedName; import java.io.Serializable; import java.util.Map; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.NoArgsConstructor; -@Getter -@Setter +@Data +@NoArgsConstructor public abstract class ControlLoopEvent implements Serializable { private static final long serialVersionUID = 2391252138583119195L; @@ -49,10 +49,6 @@ public abstract class ControlLoopEvent implements Serializable { private ControlLoopEventStatus closedLoopEventStatus; private Map<String, String> additionalEventParams; - public ControlLoopEvent() { - - } - /** * Construct an instance from an existing instance. * diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java index 924291709..c4c46d30a 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopNotification.java @@ -27,11 +27,11 @@ import java.time.ZonedDateTime; import java.util.LinkedList; import java.util.List; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.NoArgsConstructor; -@Getter -@Setter +@Data +@NoArgsConstructor public abstract class ControlLoopNotification implements Serializable { private static final long serialVersionUID = 7538596984567127915L; @@ -52,10 +52,6 @@ public abstract class ControlLoopNotification implements Serializable { private Integer opsClTimer; private List<ControlLoopOperation> history = new LinkedList<>(); - public ControlLoopNotification() { - - } - /** * Construct an instance. * diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperation.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperation.java index 85bf95a9f..10457de51 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperation.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperation.java @@ -23,7 +23,11 @@ package org.onap.policy.controlloop; import java.io.Serializable; import java.time.Instant; +import lombok.Data; +import lombok.NoArgsConstructor; +@Data +@NoArgsConstructor public class ControlLoopOperation implements Serializable { private static final long serialVersionUID = 8662706581293017099L; @@ -37,10 +41,6 @@ public class ControlLoopOperation implements Serializable { private String outcome; private String message; - public ControlLoopOperation() { - - } - /** * Construct an instance from an existing instance. * @@ -70,161 +70,10 @@ public class ControlLoopOperation implements Serializable { + ",subRequestId=" + subRequestId + ",outcome=" + outcome + ",message=" + message; } - public String getActor() { - return actor; - } - - public void setActor(String actor) { - this.actor = actor; - } - - public String getOperation() { - return operation; - } - - public void setOperation(String operation) { - this.operation = operation; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public Instant getStart() { - return start; - } - - public void setStart(Instant start) { - this.start = start; - } - - public Instant getEnd() { - return end; - } - - public void setEnd(Instant end) { - this.end = end; - } - - public String getSubRequestId() { - return subRequestId; - } - - public void setSubRequestId(String subRequestId) { - this.subRequestId = subRequestId; - } - - public String getOutcome() { - return outcome; - } - - public void setOutcome(String outcome) { - this.outcome = outcome; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - @Override public String toString() { return "ControlLoopOperation [actor=" + actor + ", operation=" + operation + ", target=" + target + ", start=" + start + ", end=" + end + ", subRequestId=" + subRequestId + ", outcome=" + outcome + ", message=" + message + "]"; } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((actor == null) ? 0 : actor.hashCode()); - result = prime * result + ((end == null) ? 0 : end.hashCode()); - result = prime * result + ((message == null) ? 0 : message.hashCode()); - result = prime * result + ((operation == null) ? 0 : operation.hashCode()); - result = prime * result + ((outcome == null) ? 0 : outcome.hashCode()); - result = prime * result + ((start == null) ? 0 : start.hashCode()); - result = prime * result + ((subRequestId == null) ? 0 : subRequestId.hashCode()); - result = prime * result + ((target == null) ? 0 : target.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ControlLoopOperation other = (ControlLoopOperation) obj; - if (actor == null) { - if (other.actor != null) { - return false; - } - } else if (!actor.equals(other.actor)) { - return false; - } - if (end == null) { - if (other.end != null) { - return false; - } - } else if (!end.equals(other.end)) { - return false; - } - if (message == null) { - if (other.message != null) { - return false; - } - } else if (!message.equals(other.message)) { - return false; - } - if (operation == null) { - if (other.operation != null) { - return false; - } - } else if (!operation.equals(other.operation)) { - return false; - } - if (outcome == null) { - if (other.outcome != null) { - return false; - } - } else if (!outcome.equals(other.outcome)) { - return false; - } - if (start == null) { - if (other.start != null) { - return false; - } - } else if (!start.equals(other.start)) { - return false; - } - if (subRequestId == null) { - if (other.subRequestId != null) { - return false; - } - } else if (!subRequestId.equals(other.subRequestId)) { - return false; - } - if (target == null) { - if (other.target != null) { - return false; - } - } else if (!target.equals(other.target)) { - return false; - } - return true; - } - } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperationWrapper.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperationWrapper.java index 1d1a9676a..7195c9de4 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperationWrapper.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopOperationWrapper.java @@ -22,34 +22,15 @@ package org.onap.policy.controlloop; import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +@Data +@NoArgsConstructor +@AllArgsConstructor public class ControlLoopOperationWrapper { private UUID requestId; private ControlLoopOperation operation; - - public ControlLoopOperationWrapper() { - - } - - public ControlLoopOperationWrapper(UUID requestId, ControlLoopOperation operation) { - this.requestId = requestId; - this.operation = operation; - } - - public UUID getRequestId() { - return requestId; - } - - public void setRequestId(UUID requestId) { - this.requestId = requestId; - } - - public ControlLoopOperation getOperation() { - return operation; - } - - public void setOperation(ControlLoopOperation operation) { - this.operation = operation; - } } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopResponse.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopResponse.java index a73d47744..1067b3ff7 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopResponse.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopResponse.java @@ -25,41 +25,27 @@ import com.google.gson.annotations.SerializedName; import java.io.Serializable; import java.util.UUID; +import lombok.Data; +import lombok.NoArgsConstructor; +@Data +@NoArgsConstructor public class ControlLoopResponse implements Serializable { private static final long serialVersionUID = 2391252138583119195L; - @SerializedName("closedLoopControlName") - private String closedLoopControlName; - - @SerializedName("version") - private String version = "1.0.0"; - @SerializedName("requestID") private UUID requestId; - - @SerializedName("target") + private String closedLoopControlName; + private String version = "1.0.0"; private String target; - - @SerializedName("from") private String from; - - @SerializedName("policyName") private String policyName; - - @SerializedName("policyVersion") private String policyVersion; - - @SerializedName("payload") private String payload; - public ControlLoopResponse() { - - } - /** - * Construct an instace from an existing instance. + * Construct an instance from an existing instance. * * @param response * the existing instance @@ -75,69 +61,6 @@ public class ControlLoopResponse implements Serializable { this.policyName = response.policyName; this.policyVersion = response.policyVersion; this.payload = response.payload; - } - - public String getClosedLoopControlName() { - return closedLoopControlName; - } - - public void setClosedLoopControlName(String closedLoopControlName) { - this.closedLoopControlName = closedLoopControlName; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public UUID getRequestId() { - return requestId; - } - - public void setRequestId(UUID requestId) { - this.requestId = requestId; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public String getPolicyVersion() { - return policyVersion; - } - - public void setPolicyVersion(String policyVersion) { - this.policyVersion = policyVersion; - } - - public String getPayload() { - return payload; - } - - public void setPayload(String payload) { - this.payload = payload; + this.version = response.version; } } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java index 43026a202..24cc81dcd 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopEvent.java @@ -26,30 +26,23 @@ import com.google.gson.annotations.SerializedName; import java.time.Instant; import java.util.HashMap; import java.util.Map; -import lombok.Getter; -import lombok.Setter; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; -@Getter -@Setter +@Data +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor public class VirtualControlLoopEvent extends ControlLoopEvent { private static final long serialVersionUID = -5752405682246066226L; - @SerializedName("payload") + @SerializedName("AAI") + private Map<String, String> aai = new HashMap<>(); private String payload; - - @SerializedName("closedLoopAlarmStart") private Instant closedLoopAlarmStart; - - @SerializedName("closedLoopAlarmEnd") private Instant closedLoopAlarmEnd; - @SerializedName("AAI") - private Map<String, String> aai = new HashMap<>(); - - public VirtualControlLoopEvent() {} - - /** * Construct an instance from an existing instance. * diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java index 857bdf0c0..1fcda16d0 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/VirtualControlLoopNotification.java @@ -26,22 +26,22 @@ import com.google.gson.annotations.SerializedName; import java.time.Instant; import java.util.HashMap; import java.util.Map; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +@Data +@EqualsAndHashCode(callSuper = true) +@NoArgsConstructor public class VirtualControlLoopNotification extends ControlLoopNotification { private static final long serialVersionUID = 5354756047932144017L; @SerializedName("AAI") private Map<String, String> aai = new HashMap<>(); - - @SerializedName("closedLoopAlarmStart") private Instant closedLoopAlarmStart; - - @SerializedName("closedLoopAlarmEnd") private Instant closedLoopAlarmEnd; - public VirtualControlLoopNotification() {} - /** * Construct an instance. * @@ -58,28 +58,4 @@ public class VirtualControlLoopNotification extends ControlLoopNotification { this.closedLoopAlarmStart = event.getClosedLoopAlarmStart(); this.closedLoopAlarmEnd = event.getClosedLoopAlarmEnd(); } - - public Map<String, String> getAai() { - return aai; - } - - public void setAai(Map<String, String> aai) { - this.aai = aai; - } - - public Instant getClosedLoopAlarmStart() { - return closedLoopAlarmStart; - } - - public void setClosedLoopAlarmStart(Instant closedLoopAlarmStart) { - this.closedLoopAlarmStart = closedLoopAlarmStart; - } - - public Instant getClosedLoopAlarmEnd() { - return closedLoopAlarmEnd; - } - - public void setClosedLoopAlarmEnd(Instant closedLoopAlarmEnd) { - this.closedLoopAlarmEnd = closedLoopAlarmEnd; - } } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/params/ControlLoopParams.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/params/ControlLoopParams.java index 11b90af99..36f804f6e 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/params/ControlLoopParams.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/params/ControlLoopParams.java @@ -22,7 +22,13 @@ package org.onap.policy.controlloop.params; import java.io.Serializable; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +@Data +@AllArgsConstructor +@NoArgsConstructor public class ControlLoopParams implements Serializable { private static final long serialVersionUID = 970755684770982776L; @@ -33,10 +39,6 @@ public class ControlLoopParams implements Serializable { private String policyScope; private String policyVersion; - public ControlLoopParams() { - super(); - } - /** * Construct an instance from an existing instance. * @@ -49,45 +51,4 @@ public class ControlLoopParams implements Serializable { this.policyScope = params.policyScope; this.policyVersion = params.policyVersion; } - - public String getClosedLoopControlName() { - return closedLoopControlName; - } - - public void setClosedLoopControlName(String closedLoopControlName) { - this.closedLoopControlName = closedLoopControlName; - } - - public String getControlLoopYaml() { - return controlLoopYaml; - } - - public void setControlLoopYaml(String controlLoopYaml) { - this.controlLoopYaml = controlLoopYaml; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public String getPolicyScope() { - return policyScope; - } - - public void setPolicyScope(String policyScope) { - this.policyScope = policyScope; - } - - public String getPolicyVersion() { - return policyVersion; - } - - public void setPolicyVersion(String policyVersion) { - this.policyVersion = policyVersion; - } - } |