From f3543a4c233de61e3a84b366ecab337d1c1a4ff5 Mon Sep 17 00:00:00 2001 From: danikov Date: Thu, 9 Feb 2012 19:08:14 +0000 Subject: [PATCH] domain objects --- .../vcloud/director/v1_5/domain/File.java | 300 ++++++++++++++++++ .../director/v1_5/domain/FilesList.java | 159 ++++++++++ .../vcloud/director/v1_5/domain/Media.java | 230 ++++++++++++++ .../vcloud/director/v1_5/domain/Owner.java | 199 ++++++++++++ .../v1_5/domain/ResourceEntityType.java | 265 ++++++++++++++++ 5 files changed, 1153 insertions(+) create mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java create mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/FilesList.java create mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java create mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java create mode 100644 labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java new file mode 100644 index 0000000000..ea9369ecb1 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/File.java @@ -0,0 +1,300 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +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.net.URI; +import java.util.Set; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +import com.google.common.base.Objects; +import com.google.common.collect.Sets; + + +/** + * + * Represents a file to be transferred (uploaded or downloaded). + * + * + *

Java class for File complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="File">
+ *   <complexContent>
+ *     <extension base="{http://www.vmware.com/vcloud/v1.5}EntityType">
+ *       <attribute name="size" type="{http://www.w3.org/2001/XMLSchema}long" />
+ *       <attribute name="bytesTransferred" type="{http://www.w3.org/2001/XMLSchema}long" />
+ *       <attribute name="checksum" type="{http://www.w3.org/2001/XMLSchema}normalizedString" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "File") +public class File + extends EntityType + +{ + @SuppressWarnings("unchecked") + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromFile(this); + } + + public static class Builder extends EntityType.Builder { + + private Long size; + private Long bytesTransferred; + private String checksum; + + /** + * @see File#getSize() + */ + public Builder size(Long size) { + this.size = size; + return this; + } + + /** + * @see File#getBytesTransferred() + */ + public Builder bytesTransferred(Long bytesTransferred) { + this.bytesTransferred = bytesTransferred; + return this; + } + + /** + * @see File#getChecksum() + */ + public Builder checksum(String checksum) { + this.checksum = checksum; + return this; + } + + + public File build() { + File file = new File(); + file.setSize(size); + file.setBytesTransferred(bytesTransferred); + file.setChecksum(checksum); + return file; + } + + + /** + * @see EntityType#getId() + */ + @Override + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * @see EntityType#getTasksInProgress() + */ + @Override + public Builder tasksInProgress(TasksInProgress tasksInProgress) { + this.tasksInProgress = tasksInProgress; + return this; + } + + /** + * @see ReferenceType#getHref() + */ + @Override + public Builder href(URI href) { + this.href = href; + return this; + } + + /** + * @see ReferenceType#getType() + */ + @Override + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * @see ReferenceType#getLinks() + */ + @Override + public Builder links(Set links) { + this.links = Sets.newLinkedHashSet(checkNotNull(links, "links")); + return this; + } + + /** + * @see ReferenceType#getLinks() + */ + @Override + public Builder link(Link link) { + this.links.add(checkNotNull(link, "link")); + return this; + } + + + @Override + public Builder fromEntityType(EntityType in) { + return Builder.class.cast(super.fromEntityType(in)); + } + public Builder fromFile(File in) { + return fromEntityType(in) + .size(in.getSize()) + .bytesTransferred(in.getBytesTransferred()) + .checksum(in.getChecksum()); + } + } + + private File() { + // For JAXB and builder use + } + + + + @XmlAttribute + protected Long size; + @XmlAttribute + protected Long bytesTransferred; + @XmlAttribute + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + @XmlSchemaType(name = "normalizedString") + protected String checksum; + + /** + * Gets the value of the size property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getSize() { + return size; + } + + /** + * Sets the value of the size property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setSize(Long value) { + this.size = value; + } + + /** + * Gets the value of the bytesTransferred property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getBytesTransferred() { + return bytesTransferred; + } + + /** + * Sets the value of the bytesTransferred property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setBytesTransferred(Long value) { + this.bytesTransferred = value; + } + + /** + * Gets the value of the checksum property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getChecksum() { + return checksum; + } + + /** + * Sets the value of the checksum property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setChecksum(String value) { + this.checksum = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + File that = File.class.cast(o); + return equal(size, that.size) && + equal(bytesTransferred, that.bytesTransferred) && + equal(checksum, that.checksum); + } + + @Override + public int hashCode() { + return Objects.hashCode(size, + bytesTransferred, + checksum); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("size", size) + .add("bytesTransferred", bytesTransferred) + .add("checksum", checksum).toString(); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/FilesList.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/FilesList.java new file mode 100644 index 0000000000..39c7eff127 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/FilesList.java @@ -0,0 +1,159 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.jclouds.vcloud.director.v1_5.domain; + +import static com.google.common.base.Objects.equal; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import com.google.common.base.Objects; + + +/** + * + * Represents a list of files to be transferred (uploaded + * or downloaded). + * + * + *

Java class for FilesList complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="FilesList">
+ *   <complexContent>
+ *     <extension base="{http://www.vmware.com/vcloud/v1.5}VCloudExtensibleType">
+ *       <sequence>
+ *         <element name="File" type="{http://www.vmware.com/vcloud/v1.5}FileType" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "FilesList", propOrder = { + "file" +}) +public class FilesList { + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromFilesList(this); + } + + public static class Builder { + + private List files; + + /** + * @see FilesList#getFile() + */ + public Builder file(List file) { + this.files = file; + return this; + } + + + public FilesList build() { + FilesList filesList = new FilesList(files); + return filesList; + } + + + public Builder fromFilesList(FilesList in) { + return file(in.getFile()); + } + } + + private FilesList() { + // For JAXB and builder use + } + + private FilesList(List files) { + this.files = files; + } + + + @XmlElement(name = "File", required = true) + protected List files; + + /** + * Gets the value of the file property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the file property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getFile().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link FileType } + * + * + */ + public List getFile() { + if (files == null) { + files = new ArrayList(); + } + return this.files; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + FilesList that = FilesList.class.cast(o); + return equal(files, that.files); + } + + @Override + public int hashCode() { + return Objects.hashCode(files); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("file", files).toString(); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java new file mode 100644 index 0000000000..e9f9a256d8 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Media.java @@ -0,0 +1,230 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.jclouds.vcloud.director.v1_5.domain; + +import static com.google.common.base.Objects.equal; + +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.XmlType; + +import com.google.common.base.Objects; + + +/** + * + * Represents a media. + * + * + *

Java class for Media complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Media">
+ *   <complexContent>
+ *     <extension base="{http://www.vmware.com/vcloud/v1.5}ResourceEntityType">
+ *       <sequence>
+ *         <element name="Owner" type="{http://www.vmware.com/vcloud/v1.5}OwnerType" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="imageType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="size" use="required" type="{http://www.w3.org/2001/XMLSchema}long" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Media", propOrder = { + "owner" +}) +public class Media + extends ResourceEntityType + +{ + @SuppressWarnings("unchecked") + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromMedia(this); + } + + public static class Builder extends ResourceEntityType.Builder { + + private Owner owner; + private String imageType; + private long size; + + /** + * @see Media#getOwner() + */ + public Builder owner(Owner owner) { + this.owner = owner; + return this; + } + + /** + * @see Media#getImageType() + */ + public Builder imageType(String imageType) { + this.imageType = imageType; + return this; + } + + /** + * @see Media#getSize() + */ + public Builder size(long size) { + this.size = size; + return this; + } + + + public Media build() { + Media media = new Media(); + media.setOwner(owner); + media.setImageType(imageType); + media.setSize(size); + return media; + } + + + @Override + public Builder fromResourceEntityType(ResourceEntityType in) { + return Builder.class.cast(super.fromResourceEntityType(in)); + } + public Builder fromMedia(Media in) { + return fromResourceEntityType(in) + .owner(in.getOwner()) + .imageType(in.getImageType()) + .size(in.getSize()); + } + } + + public Media() { + super(); + } + + @XmlElement(name = "Owner") + protected Owner owner; + @XmlAttribute(required = true) + protected String imageType; + @XmlAttribute(required = true) + protected long size; + + /** + * Gets the value of the owner property. + * + * @return + * possible object is + * {@link Owner } + * + */ + public Owner getOwner() { + return owner; + } + + /** + * Sets the value of the owner property. + * + * @param value + * allowed object is + * {@link Owner } + * + */ + public void setOwner(Owner value) { + this.owner = value; + } + + /** + * Gets the value of the imageType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getImageType() { + return imageType; + } + + /** + * Sets the value of the imageType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setImageType(String value) { + this.imageType = value; + } + + /** + * Gets the value of the size property. + * + */ + public long getSize() { + return size; + } + + /** + * Sets the value of the size property. + * + */ + public void setSize(long value) { + this.size = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Media that = Media.class.cast(o); + return equal(owner, that.owner) && + equal(imageType, that.imageType) && + equal(size, that.size); + } + + @Override + public int hashCode() { + return Objects.hashCode(owner, + imageType, + size); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("owner", owner) + .add("imageType", imageType) + .add("size", size).toString(); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java new file mode 100644 index 0000000000..642bd159ff --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/Owner.java @@ -0,0 +1,199 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +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.net.URI; +import java.util.Set; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +import com.google.common.base.Objects; +import com.google.common.collect.Sets; + + +/** + * + * Represents the owner of this entity. + * + * + *

Java class for Owner complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="Owner">
+ *   <complexContent>
+ *     <extension base="{http://www.vmware.com/vcloud/v1.5}ResourceType">
+ *       <sequence>
+ *         <element name="User" type="{http://www.vmware.com/vcloud/v1.5}ReferenceType"/>
+ *       </sequence>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Owner", propOrder = { + "user" +}) +public class Owner + extends ResourceType + +{ + @SuppressWarnings("unchecked") + public static Builder builder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder().fromOwner(this); + } + + public static class Builder extends ResourceType.Builder { + + private Reference user; + + /** + * @see Owner#getUser() + */ + public Builder user(Reference user) { + this.user = user; + return this; + } + + + public Owner build() { + Owner owner = new Owner(); + owner.setUser(user); + return owner; + } + + + /** + * @see ResourceType#getHref() + */ + @Override + public Builder href(URI href) { + super.href(href); + return this; + } + + /** + * @see ResourceType#getType() + */ + @Override + public Builder type(String type) { + super.type(type); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder links(Set links) { + super.links(Sets.newLinkedHashSet(checkNotNull(links, "links"))); + return this; + } + + /** + * @see ResourceType#getLinks() + */ + @Override + public Builder link(Link link) { + super.link(link); + return this; + } + + + @Override + public Builder fromResourceType(ResourceType in) { + return Builder.class.cast(super.fromResourceType(in)); + } + public Builder fromOwner(Owner in) { + return fromResourceType(in) + .user(in.getUser()); + } + } + + private Owner() { + // For JAXB and builder use + } + + + + @XmlElement(name = "User", required = true) + protected Reference user; + + /** + * Gets the value of the user property. + * + * @return + * possible object is + * {@link Reference } + * + */ + public Reference getUser() { + return user; + } + + /** + * Sets the value of the user property. + * + * @param value + * allowed object is + * {@link Reference } + * + */ + public void setUser(Reference value) { + this.user = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + Owner that = Owner.class.cast(o); + return equal(user, that.user); + } + + @Override + public int hashCode() { + return Objects.hashCode(user); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("user", user).toString(); + } + +} diff --git a/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java new file mode 100644 index 0000000000..56c9ac6ea0 --- /dev/null +++ b/labs/vcloud-director/src/main/java/org/jclouds/vcloud/director/v1_5/domain/ResourceEntityType.java @@ -0,0 +1,265 @@ +/** + * Licensed to jclouds, Inc. (jclouds) under one or more + * contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. jclouds licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +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.net.URI; +import java.util.Set; + +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.XmlType; + +import com.google.common.base.Objects; +import com.google.common.collect.Sets; + + +/** + * + * Base type that represents a resource entity such as a vApp + * template or virtual media. + * + * + *

Java class for ResourceEntity complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ResourceEntity">
+ *   <complexContent>
+ *     <extension base="{http://www.vmware.com/vcloud/v1.5}EntityType">
+ *       <sequence>
+ *         <element name="Files" type="{http://www.vmware.com/vcloud/v1.5}FilesListType" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="status" type="{http://www.w3.org/2001/XMLSchema}int" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ResourceEntity", propOrder = { + "files" +}) +//@XmlSeeAlso({ +// MediaType.class, +// VAppTemplateType.class, +// AbstractVAppType.class, +// NetworkPoolType.class +//}) +public class ResourceEntityType> extends EntityType { + + public static > Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return new Builder().fromResourceEntityType(this); + } + + public static class Builder> extends EntityType.Builder { + + private FilesList files; + private Integer status; + + /** + * @see ResourceEntityType#getFiles() + */ + public Builder files(FilesList files) { + this.files = files; + return this; + } + + /** + * @see ResourceEntityType#getStatus() + */ + public Builder status(Integer status) { + this.status = status; + return this; + } + + + public ResourceEntityType build() { + ResourceEntityType resourceEntity = new ResourceEntityType(); + resourceEntity.setFiles(files); + resourceEntity.setStatus(status); + return resourceEntity; + } + + + /** + * @see EntityType#getId() + */ + @Override + public Builder id(String id) { + this.id = id; + return this; + } + + /** + * @see EntityType#getTasksInProgress() + */ + @Override + public Builder tasksInProgress(TasksInProgress tasksInProgress) { + this.tasksInProgress = tasksInProgress; + return this; + } + + /** + * @see ReferenceType#getHref() + */ + @Override + public Builder href(URI href) { + this.href = href; + return this; + } + + /** + * @see ReferenceType#getType() + */ + @Override + public Builder type(String type) { + this.type = type; + return this; + } + + /** + * @see ReferenceType#getLinks() + */ + @Override + public Builder links(Set links) { + this.links = Sets.newLinkedHashSet(checkNotNull(links, "links")); + return this; + } + + /** + * @see ReferenceType#getLinks() + */ + @Override + public Builder link(Link link) { + this.links.add(checkNotNull(link, "link")); + return this; + } + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + public Builder fromResourceType(ResourceType in) { + return Builder.class.cast(super.fromResourceType(in)); + } + + public Builder fromResourceEntityType(ResourceEntityType in) { + return fromResourceType(in) + .files(in.getFiles()) + .status(in.getStatus()); + } + } + + public ResourceEntityType() { + } + + @XmlElement(name = "Files") + protected FilesList files; + @XmlAttribute + protected Integer status; + + /** + * Gets the value of the files property. + * + * @return + * possible object is + * {@link FilesList } + * + */ + public FilesList getFiles() { + return files; + } + + /** + * Sets the value of the files property. + * + * @param value + * allowed object is + * {@link FilesList } + * + */ + public void setFiles(FilesList value) { + this.files = value; + } + + /** + * Gets the value of the status property. + * + * @return + * possible object is + * {@link Integer } + * + */ + public Integer getStatus() { + return status; + } + + /** + * Sets the value of the status property. + * + * @param value + * allowed object is + * {@link Integer } + * + */ + public void setStatus(Integer value) { + this.status = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + ResourceEntityType that = ResourceEntityType.class.cast(o); + return equal(files, that.files) && + equal(status, that.status); + } + + @Override + public int hashCode() { + return Objects.hashCode(files, + status); + } + + @Override + public String toString() { + return Objects.toStringHelper("") + .add("files", files) + .add("status", status).toString(); + } + +}