Merge "Removing { } from NormalizedNodeJsonBodyWriter"
[controller.git] / opendaylight / networkconfiguration / neutron / northbound / src / main / java / org / opendaylight / controller / networkconfig / neutron / northbound / NeutronSecurityRuleRequest.java
1 /*
2  * Copyright (C) 2014 Red Hat, Inc.
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
10 package org.opendaylight.controller.networkconfig.neutron.northbound;
11
12 import org.opendaylight.controller.networkconfig.neutron.NeutronSecurityRule;
13
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlRootElement;
18 import java.util.List;
19
20
21 @XmlRootElement
22 @XmlAccessorType(XmlAccessType.NONE)
23
24 public class NeutronSecurityRuleRequest {
25     /**
26      * See OpenStack Network API v2.0 Reference for a
27      * description of annotated attributes and operations
28      */
29
30     @XmlElement(name="security_group_rule")
31     NeutronSecurityRule singletonSecurityRule;
32
33     @XmlElement(name="security_group_rules")
34     List<NeutronSecurityRule> bulkRequest;
35
36     NeutronSecurityRuleRequest() {
37     }
38
39     NeutronSecurityRuleRequest(List<NeutronSecurityRule> bulk) {
40         bulkRequest = bulk;
41         singletonSecurityRule = null;
42     }
43
44     NeutronSecurityRuleRequest(NeutronSecurityRule rule) {
45         singletonSecurityRule = rule;
46     }
47
48     public NeutronSecurityRule getSingleton() {
49         return singletonSecurityRule;
50     }
51
52     public boolean isSingleton() {
53         return (singletonSecurityRule != null);
54     }
55     public List<NeutronSecurityRule> getBulk() {
56         return bulkRequest;
57     }
58
59 }