mirror of https://github.com/apache/jclouds.git
add incremental builder method
This commit is contained in:
parent
6a4ccc5178
commit
1b2da14aab
|
@ -20,13 +20,14 @@
|
|||
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.Set;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.google.common.base.Objects;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
|
||||
|
@ -66,23 +67,29 @@ public class FilesList {
|
|||
|
||||
public static class Builder {
|
||||
|
||||
private Set<File> files = Sets.newLinkedHashSet();
|
||||
private List<File> files = Lists.newLinkedList();
|
||||
|
||||
/**
|
||||
* @see FilesList#getFiles()
|
||||
*/
|
||||
public Builder files(Set<File> files) {
|
||||
this.files = files;
|
||||
public Builder files(List<File> files) {
|
||||
this.files = Lists.newLinkedList(checkNotNull(files, "files"));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see FilesList#getFiles()
|
||||
*/
|
||||
public Builder file(File file) {
|
||||
files.add(checkNotNull(file, "file"));
|
||||
return this;
|
||||
}
|
||||
|
||||
public FilesList build() {
|
||||
FilesList filesList = new FilesList(files);
|
||||
return filesList;
|
||||
}
|
||||
|
||||
|
||||
public Builder fromFilesList(FilesList in) {
|
||||
return files(in.getFiles());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue