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;
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;
18 @XmlAccessorType(XmlAccessType.NONE)
19 public final class NeutronMeteringLabelRule extends NeutronObject<NeutronMeteringLabelRule>
20 implements Serializable, INeutronObject<NeutronMeteringLabelRule> {
21 private static final long serialVersionUID = 1L;
23 @XmlElement(name = "direction")
24 String meteringLabelRuleDirection;
26 @XmlElement(defaultValue = "false", name = "excluded")
27 Boolean meteringLabelRuleExcluded;
29 @XmlElement(name = "remote_ip_prefix")
30 String meteringLabelRuleRemoteIpPrefix;
32 @XmlElement(name = "metering_label_id")
33 String meteringLabelRuleLabelID;
39 public String getMeteringLabelRuleDirection() {
40 return meteringLabelRuleDirection;
43 public void setMeteringLabelRuleDirection(String direction) {
44 this.meteringLabelRuleDirection = direction;
47 public Boolean getMeteringLabelRuleExcluded() {
48 return meteringLabelRuleExcluded;
51 public void setMeteringLabelRuleExcluded(Boolean excluded) {
52 this.meteringLabelRuleExcluded = excluded;
55 public String getMeteringLabelRuleRemoteIpPrefix() {
56 return meteringLabelRuleRemoteIpPrefix;
59 public void setMeteringLabelRuleRemoteIpPrefix(String prefix) {
60 this.meteringLabelRuleRemoteIpPrefix = prefix;
63 public String getMeteringLabelRuleLabelID() {
64 return meteringLabelRuleLabelID;
67 public void setMeteringLabelRuleLabelID(String meteringLabelID) {
68 this.meteringLabelRuleLabelID = meteringLabelID;
74 public NeutronMeteringLabelRule() {
78 public String toString() {
79 return "NeutronMeteringLabelRule [id=" + uuid + ", tenantID=" + tenantID + ", direction="
80 + meteringLabelRuleDirection + ", excluded=" + meteringLabelRuleExcluded + ", remote_ip_prefix="
81 + meteringLabelRuleRemoteIpPrefix + ", metering_label_id=" + meteringLabelRuleLabelID + "]";
85 protected boolean extractField(String field, NeutronMeteringLabelRule ans) {
88 ans.setMeteringLabelRuleDirection(this.getMeteringLabelRuleDirection());
91 ans.setMeteringLabelRuleExcluded(this.getMeteringLabelRuleExcluded());
93 case "remote_ip_prefix":
94 ans.setMeteringLabelRuleRemoteIpPrefix(this.getMeteringLabelRuleRemoteIpPrefix());
96 case "metering_label_id":
97 ans.setMeteringLabelRuleLabelID(this.getMeteringLabelRuleLabelID());
100 return super.extractField(field, ans);