2 * Copyright (c) 2016 Intel Corporation. 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.math.BigInteger;
13 import java.util.Iterator;
14 import java.util.List;
15 import javax.xml.bind.annotation.XmlAccessType;
16 import javax.xml.bind.annotation.XmlAccessorType;
17 import javax.xml.bind.annotation.XmlElement;
18 import javax.xml.bind.annotation.XmlRootElement;
21 @XmlAccessorType(XmlAccessType.NONE)
22 public final class NeutronQosBandwidthRule extends NeutronObject<NeutronQosBandwidthRule>
23 implements Serializable, INeutronObject<NeutronQosBandwidthRule> {
24 private static final long serialVersionUID = 1L;
26 @XmlElement(name = "max_kbps")
29 @XmlElement(name = "max_burst_kbps")
30 BigInteger maxBurstKbps;
32 public BigInteger getMaxKbps() {
36 public void setMaxKbps(BigInteger maxKbps) {
37 this.maxKbps = maxKbps;
40 public BigInteger getMaxBurstKbps() {
44 public void setMaxBurstKbps(BigInteger maxBurstKbps) {
45 this.maxBurstKbps = maxBurstKbps;
48 public NeutronQosBandwidthRule extractFields(List<String> fields) {
49 NeutronQosBandwidthRule ans = new NeutronQosBandwidthRule();
50 Iterator<String> i = fields.iterator();
54 ans.setID(this.getID());
56 if (s.equals("tenant_id")) {
57 ans.setTenantID(this.getTenantID());
59 if (s.equals("max_kbps")) {
60 ans.setMaxKbps(this.getMaxKbps());
62 if (s.equals("max_burst_kbps")) {
63 ans.setMaxBurstKbps(this.getMaxBurstKbps());
70 public String toString() {
71 return "qosBandwidthRules{" + "qosBandwidthRuleUUID='" + uuid + '\'' + ", qosBandwidthRuleTenantID='" + tenantID
72 + '\'' + ", qosBandwidthMaxValue='" + maxKbps + '\'' + ", qosBandwidthMaxBurst='" + maxBurstKbps + '\''