diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-27 10:42:17 -0500 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-01-27 10:42:32 -0500 |
commit | cfd23fabab7a07981a0f0d23797b922cdaf6e2cb (patch) | |
tree | bee8a8bdfa88cf4d0009363fb61914596cde55f1 /adapters | |
parent | 9c03f8c7dbc74b0306fc4a8be0ce22be1d2521ca (diff) |
pool is now serializable
add implements Serializable to openstack Pool object
Make Openstack Pool object serializable - for netwk
Change-Id: I9ba294b68a0896c528558ebc1d66d909a7787b47
Issue-ID: SO-1430
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'adapters')
-rw-r--r-- | adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java index 1c82907f80..ca3a9c5a8d 100644 --- a/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/onap/so/openstack/beans/Pool.java @@ -20,14 +20,15 @@ package org.onap.so.openstack.beans; +import java.io.Serializable; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.EqualsBuilder; - - - -public class Pool { +public class Pool implements Serializable { private String start; private String end; + private static final long serialVersionUID = 768026109321305392L; /** * @return the start @@ -58,5 +59,19 @@ public class Pool { public String toString() { return "Allocation_pool [start=" + start + ", end=" + end + "]"; } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof Pool)) { + return false; + } + Pool castOther = (Pool) other; + return new EqualsBuilder().append(start, castOther.start).append(end, castOther.end).isEquals(); + } + @Override + public int hashCode() { + return new HashCodeBuilder().append(start).append(end).toHashCode(); + } + } |