package org.opendaylight.neutron.spi;
-import java.io.Serializable;
-import java.util.Iterator;
-import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* OpenStack Neutron v2.0 Security Group bindings.
* See OpenStack Network API v2.0 Reference for description of
* annotated attributes. The current fields are as follows:
+ *
* <p>
* id uuid-str unique ID for the security group.
* name String name of the security group.
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
-
-public class NeutronSecurityGroup extends NeutronObject implements Serializable, INeutronObject {
+public final class NeutronSecurityGroup extends NeutronBaseAttributes<NeutronSecurityGroup> {
private static final long serialVersionUID = 1L;
- @XmlElement(name = "name")
- String securityGroupName;
-
public NeutronSecurityGroup() {
}
- public String getSecurityGroupName() {
- return securityGroupName;
- }
-
- public void setSecurityGroupName(String securityGroupName) {
- this.securityGroupName = securityGroupName;
- }
-
- public NeutronSecurityGroup extractFields(List<String> fields) {
- NeutronSecurityGroup ans = new NeutronSecurityGroup ();
- Iterator<String> i = fields.iterator ();
- while (i.hasNext ()) {
- String s = i.next ();
- if (s.equals ("id")) {
- ans.setID (this.getID ());
- }
- if (s.equals ("name")) {
- ans.setSecurityGroupName (this.getSecurityGroupName ());
- }
- if (s.equals ("tenant_id")) {
- ans.setTenantID (this.getTenantID ());
- }
- }
- return ans;
- }
-
@Override
public String toString() {
- return "NeutronSecurityGroup{" +
- "securityGroupUUID='" + uuid + '\'' +
- ", securityGroupName='" + securityGroupName + '\'' +
- ", securityGroupTenantID='" + tenantID + '\'' +
- "]";
- }
-
- @Override
- public void initDefaults() {
- //TODO verify no defaults values are nessecary required.
+ return "NeutronSecurityGroup{" + "securityGroupUUID='" + uuid + '\'' + ", securityGroupName='"
+ + name + '\'' + ", securityGroupTenantID='" + getTenantID() + '\'' + "]";
}
}