fixing a bug -- ensure setting rules in constructor

This commit is contained in:
Mike Arnold 2012-03-14 18:14:16 -05:00
parent 14f2aa4e56
commit d06f4a74cb
1 changed files with 4 additions and 1 deletions

View File

@ -19,9 +19,11 @@
package org.jclouds.openstack.nova.v1_1.domain; package org.jclouds.openstack.nova.v1_1.domain;
import static com.google.common.base.Objects.toStringHelper; import static com.google.common.base.Objects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Set; import java.util.Set;
import com.google.common.collect.ImmutableSet;
import org.jclouds.javax.annotation.Nullable; import org.jclouds.javax.annotation.Nullable;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
@ -98,6 +100,7 @@ public class SecurityGroup {
this.tenantId = tenantId; this.tenantId = tenantId;
this.name = name; this.name = name;
this.description = description; this.description = description;
this.rules = ImmutableSet.copyOf(checkNotNull(rules, "rules"));
} }
public String getId() { public String getId() {
@ -117,7 +120,7 @@ public class SecurityGroup {
} }
public Set<SecurityGroupRule> getRules() { public Set<SecurityGroupRule> getRules() {
return this.rules; return rules;
} }