From d20e0ddf4b8953ce539f1dc7bf7cb4dca30fd189 Mon Sep 17 00:00:00 2001 From: "Leigh, Phillip (pl876u)" Date: Wed, 27 Feb 2019 13:31:33 -0500 Subject: AaiCtxBuilder:Handle L-Interface & Logical-Link Also remove resourceVersion and handle empty valude of any attribute (LOG-988) Issue-ID: LOG-988 Issue-ID: LOG-766 Issue-ID: LOG-767 Change-Id: I8b3eef61cebf93690aaa0291f8d0a7c1e3575088 Signed-off-by: Leigh, Phillip (pl876u) --- .../pomba/contextbuilder/aai/datatype/Vserver.java | 35 +++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java') diff --git a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java index 803e65d..948aaa7 100644 --- a/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java +++ b/src/main/java/org/onap/pomba/contextbuilder/aai/datatype/Vserver.java @@ -24,6 +24,8 @@ import com.google.gson.annotations.SerializedName; import java.util.List; +import javax.validation.Valid; + import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -56,13 +58,17 @@ public class Vserver { @SerializedName("resource-version") @Expose private String resourceVersion; - @SerializedName("relationship-list") @Expose private RelationshipList relationshipList; + @SerializedName("l-interfaces") + @Expose + private LInterfaceInstanceList lInterfaceInstanceList; + + private List pserverInstanceList; - private List lInterfaceInstanceList; + public List getPserverInstanceList() { return pserverInstanceList; } @@ -71,14 +77,6 @@ public class Vserver { this.pserverInstanceList = pserverInstanceList; } - public List getlInterfaceInstanceList() { - return lInterfaceInstanceList; - } - - public void setlInterfaceInstanceList(List lInterfaceInstanceList) { - this.lInterfaceInstanceList = lInterfaceInstanceList; - } - private static final Gson gson = new GsonBuilder().disableHtmlEscaping().create(); public String toJson() { @@ -115,7 +113,7 @@ public class Vserver { * @param vserverId * @param isClosedLoopDisabled */ - public Vserver(String vserverId, String vserverName, String vserverName2, String provStatus, String vserverSelflink, Boolean inMaint, Boolean isClosedLoopDisabled, String resourceVersion, RelationshipList relationshipList) { + public Vserver(String vserverId, String vserverName, String vserverName2, String provStatus, String vserverSelflink, Boolean inMaint, Boolean isClosedLoopDisabled, String resourceVersion, RelationshipList relationshipList, LInterfaceInstanceList lInterfaceInstanceList) { super(); this.vserverId = vserverId; this.vserverName = vserverName; @@ -126,6 +124,7 @@ public class Vserver { this.isClosedLoopDisabled = isClosedLoopDisabled; this.resourceVersion = resourceVersion; this.relationshipList = relationshipList; + this.lInterfaceInstanceList = lInterfaceInstanceList; } public String getVserverId() { @@ -200,14 +199,22 @@ public class Vserver { this.relationshipList = relationshipList; } + public LInterfaceInstanceList getLInterfaceInstanceList() { + return lInterfaceInstanceList; + } + + public void setLInterfaceInstanceList(LInterfaceInstanceList lInterfaceInstanceList) { + this.lInterfaceInstanceList = lInterfaceInstanceList; + } + @Override public String toString() { - return new ToStringBuilder(this).append("vserverId", vserverId).append("vserverName", vserverName).append("vserverName2", vserverName2).append("provStatus", provStatus).append("vserverSelflink", vserverSelflink).append("inMaint", inMaint).append("isClosedLoopDisabled", isClosedLoopDisabled).append("resourceVersion", resourceVersion).append("relationshipList", relationshipList).toString(); + return new ToStringBuilder(this).append("vserverId", vserverId).append("vserverName", vserverName).append("vserverName2", vserverName2).append("provStatus", provStatus).append("vserverSelflink", vserverSelflink).append("inMaint", inMaint).append("isClosedLoopDisabled", isClosedLoopDisabled).append("resourceVersion", resourceVersion).append("relationshipList", relationshipList).append("lInterfaceInstanceList", lInterfaceInstanceList).toString(); } @Override public int hashCode() { - return new HashCodeBuilder().append(relationshipList).append(provStatus).append(inMaint).append(vserverName2).append(resourceVersion).append(vserverSelflink).append(vserverName).append(vserverId).append(isClosedLoopDisabled).toHashCode(); + return new HashCodeBuilder().append(relationshipList).append(lInterfaceInstanceList).append(provStatus).append(inMaint).append(vserverName2).append(resourceVersion).append(vserverSelflink).append(vserverName).append(vserverId).append(isClosedLoopDisabled).toHashCode(); } @Override @@ -219,7 +226,7 @@ public class Vserver { return false; } Vserver rhs = ((Vserver) other); - return new EqualsBuilder().append(relationshipList, rhs.relationshipList).append(provStatus, rhs.provStatus).append(inMaint, rhs.inMaint).append(vserverName2, rhs.vserverName2).append(resourceVersion, rhs.resourceVersion).append(vserverSelflink, rhs.vserverSelflink).append(vserverName, rhs.vserverName).append(vserverId, rhs.vserverId).append(isClosedLoopDisabled, rhs.isClosedLoopDisabled).isEquals(); + return new EqualsBuilder().append(relationshipList, rhs.relationshipList).append(lInterfaceInstanceList, rhs.lInterfaceInstanceList).append(provStatus, rhs.provStatus).append(inMaint, rhs.inMaint).append(vserverName2, rhs.vserverName2).append(resourceVersion, rhs.resourceVersion).append(vserverSelflink, rhs.vserverSelflink).append(vserverName, rhs.vserverName).append(vserverId, rhs.vserverId).append(isClosedLoopDisabled, rhs.isClosedLoopDisabled).isEquals(); } } -- cgit 1.2.3-korg