2 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
4 package org.openflow.protocol.action;
6 import java.nio.ByteBuffer;
9 * Represents an ofp_action_vlan_vid
10 * @author David Erickson (daviderickson@cs.stanford.edu) - Mar 11, 2010
12 public class OFActionVirtualLanIdentifier extends OFAction {
13 public static int MINIMUM_LENGTH = 8;
15 protected short virtualLanIdentifier;
17 public OFActionVirtualLanIdentifier() {
18 super.setType(OFActionType.SET_VLAN_VID);
19 super.setLength((short) MINIMUM_LENGTH);
23 * @return the virtualLanIdentifier
25 public short getVirtualLanIdentifier() {
26 return virtualLanIdentifier;
30 * @param virtualLanIdentifier the virtualLanIdentifier to set
32 public void setVirtualLanIdentifier(short virtualLanIdentifier) {
33 this.virtualLanIdentifier = virtualLanIdentifier;
37 public void readFrom(ByteBuffer data) {
39 this.virtualLanIdentifier = data.getShort();
44 public void writeTo(ByteBuffer data) {
46 data.putShort(this.virtualLanIdentifier);
47 data.putShort((short) 0);
51 public int hashCode() {
52 final int prime = 383;
53 int result = super.hashCode();
54 result = prime * result + virtualLanIdentifier;
59 public boolean equals(Object obj) {
63 if (!super.equals(obj)) {
66 if (!(obj instanceof OFActionVirtualLanIdentifier)) {
69 OFActionVirtualLanIdentifier other = (OFActionVirtualLanIdentifier) obj;
70 if (virtualLanIdentifier != other.virtualLanIdentifier) {