Issue 695: Removed setter and put annotation on field

This commit is contained in:
Jason King 2011-11-21 17:35:21 +00:00
parent 7feefaff9e
commit a1c0041650
2 changed files with 2 additions and 7 deletions

View File

@ -168,8 +168,7 @@ public class HardwareConfiguration extends BaseResource<HardwareConfiguration> {
public HardwareConfiguration(Set<Action> actions, int processorCount, @Nullable Memory memory, Set<VirtualDisk> virtualDisks, Set<VirtualNic> virtualNics) { public HardwareConfiguration(Set<Action> actions, int processorCount, @Nullable Memory memory, Set<VirtualDisk> virtualDisks, Set<VirtualNic> virtualNics) {
this.actions = Actions.builder().actions(checkNotNull(actions, "actions")).build(); this.actions = Actions.builder().actions(checkNotNull(actions, "actions")).build();
this.virtualDisks = Disks.builder().disks(checkNotNull(virtualDisks,"virtualDisks")).build(); this.virtualDisks = Disks.builder().disks(checkNotNull(virtualDisks,"virtualDisks")).build();
for( VirtualNic virtualNic: checkNotNull(virtualNics, "virtualNics")) this.virtualNics.setVirtualNic(virtualNic); this.virtualNics = Nics.builder().nics(checkNotNull(virtualNics, "virtualNics")).build();
this.processorCount = processorCount; this.processorCount = processorCount;
this.memory = memory; this.memory = memory;
} }

View File

@ -78,12 +78,8 @@ public class Nics {
this.nics = Sets.newLinkedHashSet(nics); this.nics = Sets.newLinkedHashSet(nics);
} }
private LinkedHashSet<VirtualNic> nics = Sets.newLinkedHashSet();
@XmlElement(name = "Nic") @XmlElement(name = "Nic")
public void setVirtualNic(VirtualNic nic) { private LinkedHashSet<VirtualNic> nics = Sets.newLinkedHashSet();
this.nics.add(nic);
}
public Set<VirtualNic> getVirtualNics() { public Set<VirtualNic> getVirtualNics() {
return Collections.unmodifiableSet(nics); return Collections.unmodifiableSet(nics);