diff options
author | 2020-04-03 12:23:50 -0400 | |
---|---|---|
committer | 2020-04-03 13:57:25 -0400 | |
commit | d313b58558c9c6d30ea66132b16949b7f7063cc3 (patch) | |
tree | f839b02dea4b78dca4f06f8e4ae2a2063df5ffe0 /nova-model/src/main/java/com/woorea/openstack/nova/model | |
parent | c0a1515f05edb10daa92b08ebe86668d0309d196 (diff) |
Addresses are not properly formatted
updated the format of addresses
updated unit test
Issue-ID: SO-2786
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I5b6d67ca95f33752360cfc2210420bfe2341058e
Diffstat (limited to 'nova-model/src/main/java/com/woorea/openstack/nova/model')
-rw-r--r-- | nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java index 8a61751..0226218 100644 --- a/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java @@ -24,12 +24,12 @@ import java.util.Map; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonRootName; +import com.woorea.openstack.nova.model.Server.Addresses.Address; @JsonRootName("server") public class Server implements Serializable { public static final class Addresses implements Serializable { - public static final class Address implements Serializable { @JsonProperty("OS-EXT-IPS-MAC:mac_addr") @@ -99,33 +99,9 @@ public class Server implements Serializable { this.macAddr = macAddr; } } - - private Map<String, List<Address>> addresses = new HashMap<>(); - - @JsonAnySetter - public void add(String key, List<Address> value) { - addresses.put(key, value); - } - - /** - * @return the ip address List Map - */ - public Map<String, List<Address>> getAddresses() { - return addresses; - } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "Addresses List Map [" + addresses + "]"; - } - } + public static final class Fault { private Integer code; @@ -183,7 +159,7 @@ public class Server implements Serializable { private String name; - private Addresses addresses; + private Map<String, List<Address>> addresses = new HashMap<>(); private List<Link> links; @@ -278,7 +254,7 @@ public class Server implements Serializable { /** * @return the addresses */ - public Addresses getAddresses() { + public Map<String, List<Address>> getAddresses() { return addresses; } @@ -317,6 +293,12 @@ public class Server implements Serializable { this.flavor = flavor; } + + @JsonAnySetter + public void setAddresses(String key, List<Address> value) { + addresses.put(key, value); + } + /** * @return the accessIPv4 */ |