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