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 class NeutronQosBandwidthRule extends NeutronObject implements Serializable, INeutronObject {
23 private static final long serialVersionUID = 1L;
25 @XmlElement(name = "max_kbps")
28 @XmlElement(name = "max_burst_kbps")
29 BigInteger maxBurstKbps;
31 public BigInteger getMaxKbps() {
35 public void setMaxKbps(BigInteger maxKbps) {
36 this.maxKbps = maxKbps;
39 public BigInteger getMaxBurstKbps() {
43 public void setMaxBurstKbps(BigInteger maxBurstKbps) {
44 this.maxBurstKbps = maxBurstKbps;
47 public NeutronQosBandwidthRule extractFields(List<String> fields) {
48 NeutronQosBandwidthRule ans = new NeutronQosBandwidthRule();
49 Iterator<String> i = fields.iterator();
53 ans.setID(this.getID());
55 if (s.equals("tenant_id")) {
56 ans.setTenantID(this.getTenantID());
58 if (s.equals("max_kbps")) {
59 ans.setMaxKbps(this.getMaxKbps());
61 if (s.equals("max_burst_kbps")) {
62 ans.setMaxBurstKbps(this.getMaxBurstKbps());
69 public String toString() {
70 return "qosBandwidthRules{" +
71 "qosBandwidthRuleUUID='" + uuid + '\'' +
72 ", qosBandwidthRuleTenantID='" + tenantID + '\'' +
73 ", qosBandwidthMaxValue='" + maxKbps + '\'' +
74 ", qosBandwidthMaxBurst='" + maxBurstKbps + '\'' +