diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AvailableNetworks.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AvailableNetworks.java index 08d398e356..d0a523b7ed 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AvailableNetworks.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/AvailableNetworks.java @@ -20,8 +20,8 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; -import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; @@ -29,6 +29,8 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +import org.testng.collections.Lists; + import com.google.common.base.Objects; @@ -58,7 +60,7 @@ import com.google.common.base.Objects; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AvailableNetworks", propOrder = { - "network" + "networks" }) public class AvailableNetworks { public static Builder builder() { @@ -71,25 +73,32 @@ public class AvailableNetworks { public static class Builder { - private List network; + private List networks = Lists.newArrayList(); /** - * @see AvailableNetworks#getNetwork() + * @see AvailableNetworks#getNetworks() */ - public Builder network(List network) { - this.network = network; + public Builder networks(List networks) { + this.networks = Lists.newArrayList(checkNotNull(networks, "networks")); return this; } + /** + * @see AvailableNetworks#getNetworks() + */ + public Builder network(Reference network) { + networks.add(checkNotNull(network, "network")); + return this; + } public AvailableNetworks build() { - AvailableNetworks availableNetworks = new AvailableNetworks(network); + AvailableNetworks availableNetworks = new AvailableNetworks(networks); return availableNetworks; } public Builder fromAvailableNetworks(AvailableNetworks in) { - return network(in.getNetwork()); + return networks(in.getNetworks()); } } @@ -97,13 +106,13 @@ public class AvailableNetworks { // For JAXB and builder use } - private AvailableNetworks(List network) { - this.network = network; + private AvailableNetworks(List networks) { + this.networks = networks; } @XmlElement(name = "Network") - protected List network; + protected List networks; /** * Gets the value of the network property. @@ -127,11 +136,11 @@ public class AvailableNetworks { * * */ - public List getNetwork() { - if (network == null) { - network = new ArrayList(); + public List getNetworks() { + if (networks == null) { + networks = Lists.newArrayList(); } - return this.network; + return this.networks; } @Override @@ -141,18 +150,18 @@ public class AvailableNetworks { if (o == null || getClass() != o.getClass()) return false; AvailableNetworks that = AvailableNetworks.class.cast(o); - return equal(network, that.network); + return equal(networks, that.networks); } @Override public int hashCode() { - return Objects.hashCode(network); + return Objects.hashCode(networks); } @Override public String toString() { return Objects.toStringHelper("") - .add("network", network).toString(); + .add("network", networks).toString(); } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityType.java index b56e9691c1..b6e968103f 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityType.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityType.java @@ -45,8 +45,8 @@ import com.google.common.base.Objects; * <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType"> * <sequence> * <element name="Units" type="{http://www.w3.org/2001/XMLSchema}string"/> - * <element name="Allocated" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/> - * <element name="Limit" type="{http://www.w3.org/2001/XMLSchema}long"/> + * <element name="Allocated" type="{http://www.w3.org/2001/XMLSchema}Long" minOccurs="0"/> + * <element name="Limit" type="{http://www.w3.org/2001/XMLSchema}Long"/> * </sequence> * <anyAttribute processContents='lax' namespace='##other'/> * </extension> @@ -79,7 +79,7 @@ public class CapacityType> { protected String units; protected Long allocated; - protected long limit; + protected Long limit; /** * @see CapacityType#getUnits() @@ -100,7 +100,7 @@ public class CapacityType> { /** * @see CapacityType#getLimit() */ - public Builder limit(long limit) { + public Builder limit(Long limit) { this.limit = limit; return this; } @@ -137,7 +137,7 @@ public class CapacityType> { @XmlElement(name = "Allocated") protected Long allocated; @XmlElement(name = "Limit") - protected long limit; + protected Long limit; /** * Gets the value of the units property. @@ -191,7 +191,7 @@ public class CapacityType> { * Gets the value of the limit property. * */ - public long getLimit() { + public Long getLimit() { return limit; } @@ -199,7 +199,7 @@ public class CapacityType> { * Sets the value of the limit property. * */ - public void setLimit(long value) { + public void setLimit(Long value) { this.limit = value; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityWithUsage.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityWithUsage.java index 7079374b97..f80e445147 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityWithUsage.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/CapacityWithUsage.java @@ -43,8 +43,8 @@ import com.google.common.base.Objects; * <complexContent> * <extension base="{http://www.vmware.com/vcloud/v1.5}CapacityType"> * <sequence> - * <element name="Used" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/> - * <element name="Overhead" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/> + * <element name="Used" type="{http://www.w3.org/2001/XMLSchema}Long" minOccurs="0"/> + * <element name="Overhead" type="{http://www.w3.org/2001/XMLSchema}Long" minOccurs="0"/> * </sequence> * <anyAttribute processContents='lax' namespace='##other'/> * </extension> @@ -121,7 +121,7 @@ public class CapacityWithUsage extends CapacityType /** * @see CapacityType#getLimit() */ - public Builder limit(long limit) { + public Builder limit(Long limit) { this.limit = limit; return this; } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java index e16805bfa6..ee6a758f70 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntities.java @@ -20,8 +20,8 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; -import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; @@ -29,6 +29,8 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +import org.testng.collections.Lists; + import com.google.common.base.Objects; @@ -46,7 +48,7 @@ import com.google.common.base.Objects; * <complexContent> * <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType"> * <sequence> - * <element name="ResourceEntity" type="{http://www.vmware.com/vcloud/v1.5}ReferenceTypeType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="ResourceEntity" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * <anyAttribute processContents='lax' namespace='##other'/> * </extension> @@ -58,7 +60,7 @@ import com.google.common.base.Objects; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ResourceEntities", propOrder = { - "resourceEntity" + "resourceEntities" }) public class ResourceEntities { public static Builder builder() { @@ -71,25 +73,32 @@ public class ResourceEntities { public static class Builder { - private List> resourceEntity; - + private List resourceEntities = Lists.newArrayList(); + /** - * @see ResourceEntities#getResourceEntity() + * @see ResourceEntities#getResourceEntities() */ - public Builder resourceEntity(List> resourceEntity) { - this.resourceEntity = resourceEntity; + public Builder resourceEntities(List resourceEntities) { + this.resourceEntities = Lists.newArrayList(checkNotNull(resourceEntities, "resourceEntities")); return this; } + /** + * @see ResourceEntities#getResourceEntities() + */ + public Builder resourceEntity(Reference resourceEntity) { + resourceEntities.add(checkNotNull(resourceEntity, "resourceEntity")); + return this; + } public ResourceEntities build() { - ResourceEntities resourceEntities = new ResourceEntities(resourceEntity); + ResourceEntities resourceEntities = new ResourceEntities(this.resourceEntities); return resourceEntities; } public Builder fromResourceEntities(ResourceEntities in) { - return resourceEntity(in.getResourceEntity()); + return resourceEntities(in.getResourceEntities()); } } @@ -97,13 +106,13 @@ public class ResourceEntities { // For JAXB and builder use } - private ResourceEntities(List> resourceEntity) { - this.resourceEntity = resourceEntity; + private ResourceEntities(List resourceEntity) { + this.resourceEntities = resourceEntity; } @XmlElement(name = "ResourceEntity") - protected List> resourceEntity; + protected List resourceEntities; /** * Gets the value of the resourceEntity property. @@ -123,15 +132,15 @@ public class ResourceEntities { * *

* Objects of the following type(s) are allowed in the list - * {@link ReferenceTypeType } + * {@link ReferenceType } * * */ - public List> getResourceEntity() { - if (resourceEntity == null) { - resourceEntity = new ArrayList>(); + public List getResourceEntities() { + if (resourceEntities == null) { + resourceEntities = Lists.newArrayList(); } - return this.resourceEntity; + return this.resourceEntities; } @Override @@ -141,18 +150,18 @@ public class ResourceEntities { if (o == null || getClass() != o.getClass()) return false; ResourceEntities that = ResourceEntities.class.cast(o); - return equal(resourceEntity, that.resourceEntity); + return equal(resourceEntities, that.resourceEntities); } @Override public int hashCode() { - return Objects.hashCode(resourceEntity); + return Objects.hashCode(resourceEntities); } @Override public String toString() { return Objects.toStringHelper("") - .add("resourceEntity", resourceEntity).toString(); + .add("resourceEntity", resourceEntities).toString(); } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SupportedHardwareVersions.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SupportedHardwareVersions.java index 8dc1a6fadf..d8338d5809 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SupportedHardwareVersions.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/SupportedHardwareVersions.java @@ -20,8 +20,8 @@ package org.jclouds.vcloud.director.v1_5.domain; import static com.google.common.base.Objects.equal; +import static com.google.common.base.Preconditions.checkNotNull; -import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; @@ -29,6 +29,8 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; +import org.testng.collections.Lists; + import com.google.common.base.Objects; @@ -58,7 +60,7 @@ import com.google.common.base.Objects; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SupportedHardwareVersions", propOrder = { - "supportedHardwareVersion" + "supportedHardwareVersions" }) public class SupportedHardwareVersions { public static Builder builder() { @@ -71,25 +73,32 @@ public class SupportedHardwareVersions { public static class Builder { - private List supportedHardwareVersion; + private List supportedHardwareVersions = Lists.newArrayList(); /** - * @see SupportedHardwareVersions#getSupportedHardwareVersion() + * @see SupportedHardwareVersions#getSupportedHardwareVersions() */ - public Builder supportedHardwareVersion(List supportedHardwareVersion) { - this.supportedHardwareVersion = supportedHardwareVersion; + public Builder supportedHardwareVersions(List supportedHardwareVersions) { + this.supportedHardwareVersions = Lists.newArrayList(checkNotNull(supportedHardwareVersions, "supportedHardwareVersions")); + return this; + } + + /** + * @see SupportedHardwareVersions#getSupportedHardwareVersions() + */ + public Builder supportedHardwareVersion(String supportedHardwareVersion) { + supportedHardwareVersions.add(checkNotNull(supportedHardwareVersion, "supportedHardwareVersion")); return this; } - public SupportedHardwareVersions build() { - SupportedHardwareVersions supportedHardwareVersions = new SupportedHardwareVersions(supportedHardwareVersion); + SupportedHardwareVersions supportedHardwareVersions = new SupportedHardwareVersions(this.supportedHardwareVersions); return supportedHardwareVersions; } public Builder fromSupportedHardwareVersions(SupportedHardwareVersions in) { - return supportedHardwareVersion(in.getSupportedHardwareVersion()); + return supportedHardwareVersions(in.getSupportedHardwareVersions()); } } @@ -97,13 +106,13 @@ public class SupportedHardwareVersions { // For JAXB and builder use } - private SupportedHardwareVersions(List supportedHardwareVersion) { - this.supportedHardwareVersion = supportedHardwareVersion; + private SupportedHardwareVersions(List supportedHardwareVersions) { + this.supportedHardwareVersions = supportedHardwareVersions; } @XmlElement(name = "SupportedHardwareVersion") - protected List supportedHardwareVersion; + protected List supportedHardwareVersions; /** * Gets the value of the supportedHardwareVersion property. @@ -127,11 +136,11 @@ public class SupportedHardwareVersions { * * */ - public List getSupportedHardwareVersion() { - if (supportedHardwareVersion == null) { - supportedHardwareVersion = new ArrayList(); + public List getSupportedHardwareVersions() { + if (supportedHardwareVersions == null) { + supportedHardwareVersions = Lists.newArrayList(); } - return this.supportedHardwareVersion; + return this.supportedHardwareVersions; } @Override @@ -141,18 +150,18 @@ public class SupportedHardwareVersions { if (o == null || getClass() != o.getClass()) return false; SupportedHardwareVersions that = SupportedHardwareVersions.class.cast(o); - return equal(supportedHardwareVersion, that.supportedHardwareVersion); + return equal(supportedHardwareVersions, that.supportedHardwareVersions); } @Override public int hashCode() { - return Objects.hashCode(supportedHardwareVersion); + return Objects.hashCode(supportedHardwareVersions); } @Override public String toString() { return Objects.toStringHelper("") - .add("supportedHardwareVersion", supportedHardwareVersion).toString(); + .add("supportedHardwareVersion", supportedHardwareVersions).toString(); } } diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdc.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdc.java index 8dc3910417..23cad56744 100644 --- a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdc.java +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Vdc.java @@ -29,6 +29,7 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; @@ -71,7 +72,8 @@ import com.google.common.collect.Sets; * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "Vdc", propOrder = { +@XmlRootElement(name = "Vdc") +@XmlType(propOrder = { "allocationModel", "storageCapacity", "computeCapacity", @@ -217,7 +219,22 @@ public class Vdc vdc.setStatus(status); return vdc; } + + /** + * @see EntityType#getName() + */ + public Builder name(String name) { + super.name(name); + return this; + } + /** + * @see EntityType#getDescription() + */ + public Builder description(String description) { + super.description(description); + return this; + } /** * @see EntityType#getId()