Updated types to fix some failing tests

This commit is contained in:
Andrew Donald Kennedy 2012-04-10 15:23:39 +01:00
parent 98f0c51b28
commit 0e01520240
2 changed files with 4 additions and 80 deletions

View File

@ -21,9 +21,7 @@ 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.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import javax.xml.bind.annotation.XmlElementRef;
@ -54,7 +52,7 @@ import com.google.common.collect.Sets;
*/
@XmlRootElement(name = "InstantiationParams")
@XmlType(name = "InstantiationParamsType")
public class InstantiationParams implements Set<SectionType> {
public class InstantiationParams {
public static Builder builder() {
return new Builder();
@ -169,81 +167,5 @@ public class InstantiationParams implements Set<SectionType> {
public String toString() {
return Objects.toStringHelper("").add("sections", sections).toString();
}
/**
* The delegate always returns a {@link Set} even if {@link #sections} is {@literal null}.
*
* The delegated {@link Set} is used by the methods implementing its interface.
* <p>
* NOTE Annoying lack of multiple inheritance for using ForwardingList!
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
private Set<SectionType> delegate() {
return (Set) getSections();
}
@Override
public boolean add(SectionType arg0) {
return delegate().add(arg0);
}
@Override
public boolean addAll(Collection<? extends SectionType> arg0) {
return delegate().addAll(arg0);
}
@Override
public void clear() {
delegate().clear();
}
@Override
public boolean contains(Object arg0) {
return delegate().contains(arg0);
}
@Override
public boolean containsAll(Collection<?> arg0) {
return delegate().containsAll(arg0);
}
@Override
public boolean isEmpty() {
return delegate().isEmpty();
}
@Override
public Iterator<SectionType> iterator() {
return delegate().iterator();
}
@Override
public boolean remove(Object arg0) {
return delegate().remove(arg0);
}
@Override
public boolean removeAll(Collection<?> arg0) {
return delegate().removeAll(arg0);
}
@Override
public boolean retainAll(Collection<?> arg0) {
return delegate().retainAll(arg0);
}
@Override
public int size() {
return delegate().size();
}
@Override
public Object[] toArray() {
return delegate().toArray();
}
@Override
public <T> T[] toArray(T[] arg0) {
return delegate().toArray(arg0);
}
}

View File

@ -30,6 +30,7 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import org.jclouds.dmtf.ovf.SectionType;
@ -45,6 +46,7 @@ import com.google.common.collect.Sets;
* </pre>
*/
@XmlRootElement(name = "NetworkConfigSection")
@XmlType(name = "NetworkConfigSectionType")
public class NetworkConfigSection extends SectionType {
public static Builder<?> builder() {