Merge "Add md-transcribing for floating IP."
[neutron.git] / northbound-api / src / main / java / org / opendaylight / neutron / northbound / api / NeutronMeteringLabelRequest.java
1 /*
2  * Copyright IBM Corporation, 2015.  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.northbound.api;
10
11 import java.util.List;
12
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
17
18 import org.opendaylight.neutron.spi.NeutronMeteringLabel;
19
20
21 @XmlRootElement
22 @XmlAccessorType(XmlAccessType.NONE)
23
24 public class NeutronMeteringLabelRequest {
25     // See OpenStack Network API v2.0 Reference for description of
26     // annotated attributes
27
28     @XmlElement(name="metering_label")
29     NeutronMeteringLabel singletonMeteringLabel;
30
31     @XmlElement(name="metering_labels")
32     List<NeutronMeteringLabel> bulkMeteringLabels;
33
34     NeutronMeteringLabelRequest() {
35     }
36
37     NeutronMeteringLabelRequest(NeutronMeteringLabel label) {
38         singletonMeteringLabel = label;
39         bulkMeteringLabels = null;
40     }
41
42     NeutronMeteringLabelRequest(List<NeutronMeteringLabel> bulk) {
43         bulkMeteringLabels = bulk;
44         singletonMeteringLabel = null;
45     }
46
47     public NeutronMeteringLabel getSingleton() {
48         return singletonMeteringLabel;
49     }
50
51     public boolean isSingleton() {
52         return (singletonMeteringLabel != null);
53     }
54
55     public List<NeutronMeteringLabel> getBulk() {
56         return bulkMeteringLabels;
57     }
58 }