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;
13 import java.util.Iterator;
14 import java.util.List;
16 import javax.xml.bind.annotation.XmlAccessType;
17 import javax.xml.bind.annotation.XmlAccessorType;
18 import javax.xml.bind.annotation.XmlElement;
19 import javax.xml.bind.annotation.XmlRootElement;
22 @XmlAccessorType(XmlAccessType.NONE)
23 public class NeutronMeteringLabel extends NeutronObject implements Serializable, INeutronObject {
24 private static final long serialVersionUID = 1L;
26 @XmlElement (name = "name")
27 String meteringLabelName;
29 @XmlElement (name = "description")
36 // @deprecated use getID()
37 public String getMeteringLabelUUID() {
41 // @deprecated use setID()
42 public void setMeteringLabelUUID(String uuid) {
46 public String getMeteringLabelName() {
47 return meteringLabelName;
50 public void setMeteringLabelName(String name) {
51 this.meteringLabelName = name;
55 public String getMeteringLabelTenantID() {
60 public void setMeteringLabelTenantID(String tenantID) {
61 setTenantID(tenantID);
64 public String getMeteringLabelDescription() {
68 public void setMeteringLabelDescription(String description) {
69 this.description = description;
75 public NeutronMeteringLabel() { }
78 public String toString() {
79 return "NeutronMeteringLabel [id=" + uuid +
80 ", name=" + meteringLabelName +
81 ", description=" + description +
82 ", tenant_id=" + tenantID + "]";
86 * This method copies selected fields from the object and returns them
87 * as a new object, suitable for marshaling.
90 * List of attributes to be extracted
91 * @return a NeutronMeteringLabel object with only the selected fields
94 public NeutronMeteringLabel extractFields(List<String> fields) {
95 NeutronMeteringLabel ans = new NeutronMeteringLabel();
96 Iterator<String> i = fields.iterator();
100 ans.setID(this.getID());
102 if (s.equals("name")) {
103 ans.setMeteringLabelName(this.getMeteringLabelName());
105 if (s.equals("tenant_id")) {
106 ans.setTenantID(this.getTenantID());
108 if (s.equals("description")) {
109 ans.setMeteringLabelDescription(this.getMeteringLabelDescription());