Issue 695: Converted setAction to addAction and moved annotation to field

This commit is contained in:
Jason King 2011-11-18 17:56:29 +00:00
parent 7a74c3cf27
commit 9852a579e9
3 changed files with 4 additions and 4 deletions

View File

@ -34,10 +34,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
*/ */
public class Actions { public class Actions {
@XmlElement(name = "Action")
private LinkedHashSet<Action> actions = Sets.newLinkedHashSet(); private LinkedHashSet<Action> actions = Sets.newLinkedHashSet();
@XmlElement(name = "Action") void addAction(Action action) {
void setAction(Action action) {
checkNotNull(action,"action"); checkNotNull(action,"action");
this.actions.add(action); this.actions.add(action);
} }

View File

@ -162,7 +162,7 @@ public class HardwareConfiguration extends BaseResource<HardwareConfiguration> {
private Nics virtualNics = new Nics(); private Nics virtualNics = new Nics();
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) {
for( Action action: checkNotNull(actions, "actions")) this.actions.setAction(action); for( Action action: checkNotNull(actions, "actions")) this.actions.addAction(action);
for( VirtualDisk disk: checkNotNull(virtualDisks, "virtualDisks")) this.virtualDisks.setVirtualDisk(disk); for( VirtualDisk disk: checkNotNull(virtualDisks, "virtualDisks")) this.virtualDisks.setVirtualDisk(disk);
for( VirtualNic virtualNic: checkNotNull(virtualNics, "virtualNics")) this.virtualNics.setVirtualNic(virtualNic); for( VirtualNic virtualNic: checkNotNull(virtualNics, "virtualNics")) this.virtualNics.setVirtualNic(virtualNic);

View File

@ -87,7 +87,7 @@ public class VirtualMachine extends BaseNamedResource<VirtualMachine> {
*/ */
public Builder actions(Set<Action> actions) { public Builder actions(Set<Action> actions) {
checkNotNull(actions,"actions"); checkNotNull(actions,"actions");
for(Action action:actions) this.actions.setAction(action); for(Action action:actions) this.actions.addAction(action);
return this; return this;
} }