From d983eb38269e721da3570a07a0997cc6c5fd2a77 Mon Sep 17 00:00:00 2001 From: Andrew Donald Kennedy Date: Thu, 9 Feb 2012 13:25:15 +0000 Subject: [PATCH] Added IsEnabled property to Org --- .../vcloud/director/v1_5/domain/Org.java | 50 ++++++++++++++++--- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java index 5fb59b9753..ad304dba98 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Org.java @@ -63,6 +63,7 @@ public class Org extends EntityType { public static class Builder extends EntityType.Builder { private String fullName; + private Boolean isEnabled; /** * @see Org#getFullName() @@ -72,6 +73,30 @@ public class Org extends EntityType { return this; } + /** + * @see Org#isEnabled() + */ + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * @see Org#isEnabled() + */ + public Builder enabled() { + this.isEnabled = Boolean.TRUE; + return this; + } + + /** + * @see Org#isEnabled() + */ + public Builder disabled() { + this.isEnabled = Boolean.FALSE; + return this; + } + @Override public Org build() { Org org = new Org(href, name, fullName); @@ -80,6 +105,7 @@ public class Org extends EntityType { org.setType(type); org.setLinks(links); org.setTasksInProgress(tasksInProgress); + org.setIsEnabled(isEnabled); return org; } @@ -174,17 +200,29 @@ public class Org extends EntityType { this.fullName = fullName; } - @XmlElement(namespace = VCLOUD_1_5_NS, name = "FullName") + @XmlElement(namespace = VCLOUD_1_5_NS, name = "FullName", required = true) private String fullName; + @XmlElement(namespace = VCLOUD_1_5_NS, name = "IsEnabled") + private Boolean isEnabled; /** - * - * @return fullName of the org + * Full name of the organization. */ public String getFullName() { return fullName; } + /** + * Full name of the organization. + */ + public Boolean isEnabled() { + return isEnabled; + } + + public void isEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } + @Override public boolean equals(Object o) { if (this == o) @@ -192,16 +230,16 @@ public class Org extends EntityType { if (o == null || getClass() != o.getClass()) return false; Org that = Org.class.cast(o); - return super.equals(that) && equal(fullName, that.fullName); + return super.equals(that) && equal(fullName, that.fullName) && equal(this.isEnabled, that.isEnabled); } @Override public int hashCode() { - return super.hashCode() + Objects.hashCode(fullName); + return super.hashCode() + Objects.hashCode(fullName, isEnabled); } @Override public ToStringHelper string() { - return super.string().add("fullName", fullName); + return super.string().add("fullName", fullName).add("isEnabled", isEnabled); } }