checkstyle: enable JavadocTagContinuationIndentation
[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 java.util.List;
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 @XmlRootElement
19 @XmlAccessorType(XmlAccessType.NONE)
20 public final class NeutronMeteringLabel extends NeutronBaseAttributes<NeutronMeteringLabel> implements Serializable {
21     private static final long serialVersionUID = 1L;
22
23     @XmlElement(defaultValue = "false", name = "shared")
24     Boolean shared;
25
26     /*
27      * getters and setters
28      */
29
30     public Boolean getMeteringLabelShared() {
31         return shared;
32     }
33
34     public void setMeteringLabelShared(Boolean shared) {
35         this.shared = shared;
36     }
37
38     /*
39      *  constructor
40      */
41     public NeutronMeteringLabel() {
42     }
43
44     @Override
45     public String toString() {
46         return "NeutronMeteringLabel [id=" + uuid + ", name=" + name + ", tenant_id=" + tenantID
47                 + ", shared=" + shared + "]";
48     }
49
50     /**
51      * This method copies selected fields from the object and returns them
52      * as a new object, suitable for marshaling.
53      *
54      * @param fields
55      *            List of attributes to be extracted
56      * @return a NeutronMeteringLabel object with only the selected fields
57      *             populated
58      */
59     public NeutronMeteringLabel extractFields(List<String> fields) {
60         NeutronMeteringLabel ans = new NeutronMeteringLabel();
61         for (String s : fields) {
62             extractField(s, ans);
63             if (s.equals("shared")) {
64                 ans.setMeteringLabelShared(this.getMeteringLabelShared());
65             }
66         }
67         return ans;
68     }
69 }