2 * Copyright (c) 2015 IBM Corporation and others. All rights reserved.
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
9 package org.opendaylight.neutron.spi;
11 import java.io.Serializable;
12 import java.util.Iterator;
13 import java.util.List;
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;
20 @XmlAccessorType(XmlAccessType.NONE)
21 public class NeutronMeteringLabel extends NeutronObject implements Serializable, INeutronObject {
22 private static final long serialVersionUID = 1L;
24 @XmlElement (name = "name")
25 String meteringLabelName;
27 @XmlElement (defaultValue = "false", name = "shared")
34 public String getMeteringLabelName() {
35 return meteringLabelName;
38 public void setMeteringLabelName(String name) {
39 this.meteringLabelName = name;
42 public Boolean getMeteringLabelShared() {
46 public void setMeteringLabelShared(Boolean shared) {
53 public NeutronMeteringLabel() { }
56 public String toString() {
57 return "NeutronMeteringLabel [id=" + uuid +
58 ", name=" + meteringLabelName +
59 ", tenant_id=" + tenantID +
60 ", shared=" + shared +
65 * This method copies selected fields from the object and returns them
66 * as a new object, suitable for marshaling.
69 * List of attributes to be extracted
70 * @return a NeutronMeteringLabel object with only the selected fields
73 public NeutronMeteringLabel extractFields(List<String> fields) {
74 NeutronMeteringLabel ans = new NeutronMeteringLabel();
75 Iterator<String> i = fields.iterator();
79 ans.setID(this.getID());
81 if (s.equals("name")) {
82 ans.setMeteringLabelName(this.getMeteringLabelName());
84 if (s.equals("tenant_id")) {
85 ans.setTenantID(this.getTenantID());
87 if (s.equals("shared")) {
88 ans.setMeteringLabelShared(this.getMeteringLabelShared());