diff options
author | Jim Hahn <jrh3@att.com> | 2021-06-17 17:35:26 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2021-06-17 17:52:40 -0400 |
commit | cad8b87bffb3b10c67f8b68ce8fcee5e5a3dcc35 (patch) | |
tree | 22748439c4a9c81bfb10e82577448e397f6c3996 /models-interactions/model-impl/appc/src/main | |
parent | 27ac6bce15318a074d4fb53606571eb30e46bf07 (diff) |
Use lombok annotations for aai, appc, appclcm, cds
Issue-ID: POLICY-3396
Change-Id: I81b6b0c7929809ffaeadadd6144e9b9f394bfdc8
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-impl/appc/src/main')
5 files changed, 22 insertions, 86 deletions
diff --git a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java index d48d7250c..e2b6be268 100644 --- a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java +++ b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * appc * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,11 +30,15 @@ import java.util.Map; import java.util.UUID; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; +import lombok.ToString; @Getter @Setter @EqualsAndHashCode +@NoArgsConstructor +@ToString public class CommonHeader implements Serializable { private static final long serialVersionUID = -3581658269910980336L; @@ -59,10 +63,6 @@ public class CommonHeader implements Serializable { @SerializedName("Flags") private Collection<Map<String, String>> flags = new ArrayList<>(); - public CommonHeader() { - // Default constructor - } - /** * Construct an instance from an existing instance. * @@ -81,11 +81,4 @@ public class CommonHeader implements Serializable { this.flags.addAll(commonHeader.flags); } } - - @Override - public String toString() { - return "CommonHeader [TimeStamp=" + timeStamp + ", APIver=" + apiVer + ", OriginatorId=" + originatorId - + ", RequestId=" + requestId + ", SubrequestId=" + subRequestId + ", RequestTrack=" + requestTrack - + ", Flags=" + flags + "]"; - } } diff --git a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java index c26566fe1..20b75d23a 100644 --- a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java +++ b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Request.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * appc * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,11 +27,15 @@ import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; +import lombok.ToString; @Getter @Setter @EqualsAndHashCode +@NoArgsConstructor +@ToString public class Request implements Serializable { private static final long serialVersionUID = -3912323643990646431L; @@ -49,15 +53,4 @@ public class Request implements Serializable { @SerializedName("Payload") private Map<String, Object> payload = new HashMap<>(); - - public Request() { - // Initiate an empty Request instance - } - - @Override - public String toString() { - return "Request [CommonHeader=" + commonHeader + ", Action=" + action + ", TargetId=" + targetId + ", ObjectId=" - + objectId + ", Payload=" + payload + "]"; - } - } diff --git a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java index 3afbd53c7..2576e3806 100644 --- a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java +++ b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/Response.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * appc * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,11 +27,15 @@ import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; +import lombok.NoArgsConstructor; import lombok.Setter; +import lombok.ToString; @Getter @Setter @EqualsAndHashCode +@NoArgsConstructor +@ToString public class Response implements Serializable { private static final long serialVersionUID = 434953706339865151L; @@ -50,10 +54,6 @@ public class Response implements Serializable { @SerializedName("Payload") private Map<String, Object> payload = new HashMap<>(); - public Response() { - - } - /** * Construct an instance from an existing instance. * @@ -67,9 +67,4 @@ public class Response implements Serializable { this.payload.putAll(request.getPayload()); } } - - @Override - public String toString() { - return "Response [CommonHeader=" + commonHeader + ", Status=" + status + ", Payload=" + payload + "]"; - } } diff --git a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java index 6a0e19a42..6e8a72de7 100644 --- a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java +++ b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/ResponseStatus.java @@ -23,11 +23,15 @@ package org.onap.policy.appc; import com.google.gson.annotations.SerializedName; import java.io.Serializable; +import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; +import lombok.ToString; @Getter @Setter +@EqualsAndHashCode +@ToString public class ResponseStatus implements Serializable { private static final long serialVersionUID = 2421770469587860452L; @@ -39,52 +43,4 @@ public class ResponseStatus implements Serializable { @SerializedName("Description") private String description; - - @Override - public String toString() { - return "ResponseStatus [Code=" + code + ", Value=" + value + ", Description=" + description + "]"; - } - - @Override - public int hashCode() { - final var prime = 31; - var result = 1; - result = prime * result + code; - result = prime * result + ((description == null) ? 0 : description.hashCode()); - result = prime * result + ((value == null) ? 0 : value.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; - } - ResponseStatus other = (ResponseStatus) obj; - if (code != other.code) { - return false; - } - if (description == null) { - if (other.description != null) { - return false; - } - } else if (!description.equals(other.description)) { - return false; - } - if (value == null) { - if (other.value != null) { - return false; - } - } else if (!value.equals(other.value)) { - return false; - } - return true; - } - } diff --git a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java index 9fa503131..faf3fc49c 100644 --- a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java +++ b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java @@ -26,9 +26,12 @@ import com.google.gson.GsonBuilder; import java.time.Instant; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import org.onap.policy.common.gson.InstantAsMillisTypeAdapter; import org.onap.policy.common.gson.ZonedDateTimeTypeAdapter; +@NoArgsConstructor(access = AccessLevel.PRIVATE) public final class Serialization { public static final DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSSxxx"); @@ -38,8 +41,4 @@ public final class Serialization { // .registerTypeAdapter(CommonHeader1607.class, new gsonCommonHeaderInstance()) // .registerTypeAdapter(ResponseStatus1607.class, new gsonResponseStatus()) .create(); - - private Serialization() { - // Private constructor to prevent subclassing - } } |