spi: consolidate common member
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronSecurityGroup.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.neutron.spi;
10
11 import java.io.Serializable;
12 import java.util.List;
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 /**
18  * OpenStack Neutron v2.0 Security Group bindings.
19  * See OpenStack Network API v2.0 Reference for description of
20  * annotated attributes. The current fields are as follows:
21  * <p>
22  * id                   uuid-str unique ID for the security group.
23  * name                 String name of the security group.
24  * tenant_id            uuid-str Owner of security rule..
25  */
26
27 @XmlRootElement
28 @XmlAccessorType(XmlAccessType.NONE)
29 public final class NeutronSecurityGroup extends NeutronBaseAttributes<NeutronSecurityGroup> implements Serializable {
30     private static final long serialVersionUID = 1L;
31
32     public NeutronSecurityGroup() {
33     }
34
35     public NeutronSecurityGroup extractFields(List<String> fields) {
36         NeutronSecurityGroup ans = new NeutronSecurityGroup();
37         for (String s : fields) {
38             extractField(s, ans);
39         }
40         return ans;
41     }
42
43     @Override
44     public String toString() {
45         return "NeutronSecurityGroup{" + "securityGroupUUID='" + uuid + '\'' + ", securityGroupName='"
46                 + name + '\'' + ", securityGroupTenantID='" + tenantID + '\'' + "]";
47     }
48
49     @Override
50     public void initDefaults() {
51         //TODO verify no defaults values are nessecary required.
52     }
53 }