Checkstyle formatting issues fix (SPI)
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronQosBandwidthRule.java
1 /*
2  * Copyright (c) 2016 Intel Corporation.  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.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;
19
20 @XmlRootElement
21 @XmlAccessorType(XmlAccessType.NONE)
22 public class NeutronQosBandwidthRule extends NeutronObject implements Serializable, INeutronObject {
23     private static final long serialVersionUID = 1L;
24
25     @XmlElement(name = "max_kbps")
26     BigInteger maxKbps;
27
28     @XmlElement(name = "max_burst_kbps")
29     BigInteger maxBurstKbps;
30
31     public BigInteger getMaxKbps() {
32         return maxKbps;
33     }
34
35     public void setMaxKbps(BigInteger maxKbps) {
36         this.maxKbps = maxKbps;
37     }
38
39     public BigInteger getMaxBurstKbps() {
40         return maxBurstKbps;
41     }
42
43     public void setMaxBurstKbps(BigInteger maxBurstKbps) {
44         this.maxBurstKbps = maxBurstKbps;
45     }
46
47     public NeutronQosBandwidthRule extractFields(List<String> fields) {
48         NeutronQosBandwidthRule ans = new NeutronQosBandwidthRule();
49         Iterator<String> i = fields.iterator();
50         while (i.hasNext()) {
51             String s = i.next();
52             if (s.equals("id")) {
53                 ans.setID(this.getID());
54             }
55             if (s.equals("tenant_id")) {
56                 ans.setTenantID(this.getTenantID());
57             }
58             if (s.equals("max_kbps")) {
59                 ans.setMaxKbps(this.getMaxKbps());
60             }
61             if (s.equals("max_burst_kbps")) {
62                 ans.setMaxBurstKbps(this.getMaxBurstKbps());
63             }
64         }
65         return ans;
66     }
67
68     @Override
69     public String toString() {
70         return "qosBandwidthRules{" + "qosBandwidthRuleUUID='" + uuid + '\'' + ", qosBandwidthRuleTenantID='" + tenantID
71                 + '\'' + ", qosBandwidthMaxValue='" + maxKbps + '\'' + ", qosBandwidthMaxBurst='" + maxBurstKbps + '\''
72                 + '}';
73     }
74 }