5b434bb5e122a4ea924b3cbd4b3053b8263b77bb
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronMeteringLabel.java
1 /*
2  * Copyright (c) 2015 IBM Corporation and others.  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 javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 @XmlRootElement
18 @XmlAccessorType(XmlAccessType.NONE)
19 public final class NeutronMeteringLabel extends NeutronBaseAttributes<NeutronMeteringLabel> implements Serializable {
20     private static final long serialVersionUID = 1L;
21
22     @XmlElement(defaultValue = "false", name = "shared")
23     Boolean shared;
24
25     /*
26      * getters and setters
27      */
28
29     public Boolean getMeteringLabelShared() {
30         return shared;
31     }
32
33     public void setMeteringLabelShared(Boolean value) {
34         this.shared = value;
35     }
36
37     /*
38      *  constructor
39      */
40     public NeutronMeteringLabel() {
41     }
42
43     @Override
44     public String toString() {
45         return "NeutronMeteringLabel [id=" + uuid + ", name=" + name + ", tenant_id=" + tenantID
46                 + ", shared=" + shared + "]";
47     }
48
49     @Override
50     protected boolean extractField(String field, NeutronMeteringLabel ans) {
51         switch (field) {
52             case "shared":
53                 ans.setMeteringLabelShared(this.getMeteringLabelShared());
54                 break;
55             default:
56                 return super.extractField(field, ans);
57         }
58         return true;
59     }
60 }