abc68ec8bddcbbcd5520ce9c3df1031a2118aef8
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronQosDscpMarkingRule.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 javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 @XmlRootElement
18 @XmlAccessorType(XmlAccessType.NONE)
19 public final class NeutronQosDscpMarkingRule extends NeutronObject<NeutronQosDscpMarkingRule>
20         implements Serializable, INeutronObject<NeutronQosDscpMarkingRule> {
21     private static final long serialVersionUID = 1L;
22
23     @XmlElement(name = "dscp_mark")
24     Short dscpMark;
25
26     public Short getDscpMark() {
27         return dscpMark;
28     }
29
30     public void setDscpMark(Short dscpMark) {
31         this.dscpMark = dscpMark;
32     }
33
34     @Override
35     protected boolean extractField(String field, NeutronQosDscpMarkingRule ans) {
36         switch (field) {
37             case "dscp_mark":
38                 ans.setDscpMark(this.getDscpMark());
39                 break;
40             default:
41                 return super.extractField(field, ans);
42         }
43         return true;
44     }
45
46     @Override
47     public String toString() {
48         return "qosDscpMarkingRules{" + "qosDscpMarkingRuleUUID='" + uuid + '\'' + ", qosDscpMarkingRuleTenantID='"
49             + tenantID + '\'' + ", qosDscpMarkingRuleDscpMark='" + dscpMark
50             + '\''
51             + '}';
52     }
53 }