From dbb7e5fb5d96e587880392fd6178ef4e080a793a Mon Sep 17 00:00:00 2001 From: Matt Stephenson Date: Tue, 27 Dec 2011 17:23:45 -0600 Subject: [PATCH] Add vcpus to the flavor entity. --- .../jclouds/openstack/nova/domain/Flavor.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/apis/nova/src/main/java/org/jclouds/openstack/nova/domain/Flavor.java b/apis/nova/src/main/java/org/jclouds/openstack/nova/domain/Flavor.java index 2916be9c37..499856b20b 100644 --- a/apis/nova/src/main/java/org/jclouds/openstack/nova/domain/Flavor.java +++ b/apis/nova/src/main/java/org/jclouds/openstack/nova/domain/Flavor.java @@ -32,7 +32,7 @@ public class Flavor extends Resource { @Override public String toString() { - return "Flavor [disk=" + disk + ", id=" + id + ", name=" + name + ", ram=" + ram + "]"; + return "Flavor [disk=" + disk + ", id=" + id + ", name=" + name + ", ram=" + ram + ", vcpus=" + vcpus +"]"; } public Flavor(int id, String name) { @@ -44,6 +44,7 @@ public class Flavor extends Resource { private String name; private Integer disk; private Integer ram; + private Integer vcpus; public Integer getDisk() { return disk; @@ -77,6 +78,14 @@ public class Flavor extends Resource { this.ram = value; } + public Integer getVcpus() { + return vcpus; + } + + public void setVcpus(Integer value) { + this.vcpus = value; + } + @Override public int hashCode() { final int prime = 31; @@ -85,6 +94,7 @@ public class Flavor extends Resource { result = prime * result + id; result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((ram == null) ? 0 : ram.hashCode()); + result = prime * result + ((vcpus == null) ? 0 : vcpus.hashCode()); return result; } @@ -114,6 +124,11 @@ public class Flavor extends Resource { return false; } else if (!ram.equals(other.ram)) return false; + if (vcpus == null) { + if (other.vcpus != null) + return false; + } else if (!vcpus.equals(other.vcpus)) + return false; return true; }