2 * Copyright (c) 2013 Cisco Systems, Inc. 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.controller.sal.action;
11 import javax.xml.bind.annotation.XmlAccessType;
12 import javax.xml.bind.annotation.XmlAccessorType;
13 import javax.xml.bind.annotation.XmlElement;
14 import javax.xml.bind.annotation.XmlRootElement;
16 import org.opendaylight.controller.sal.utils.EtherTypes;
19 * Set ethertype/length field action
23 @XmlAccessorType(XmlAccessType.NONE)
25 public class SetDlType extends Action {
26 private static final long serialVersionUID = 1L;
30 /* Dummy constructor for JAXB */
31 @SuppressWarnings("unused")
35 public SetDlType(int dlType) {
36 type = ActionType.SET_DL_TYPE;
41 public SetDlType(EtherTypes dlType) {
42 type = ActionType.SET_DL_TYPE;
43 this.dlType = dlType.intValue();
44 checkValue(this.dlType);
48 * Returns the ethertype/lenght value that this action will set
52 public int getDlType() {
57 public boolean equals(Object obj) {
61 if (!super.equals(obj)) {
64 if (getClass() != obj.getClass()) {
67 SetDlType other = (SetDlType) obj;
68 if (dlType != other.dlType) {
75 public int hashCode() {
77 int result = super.hashCode();
78 result = prime * result + dlType;
83 public String toString() {
84 return type + "[dlType = 0x" + Integer.toHexString(dlType) + "]";