1 package org.openflow.protocol.statistics;
3 import java.io.Serializable;
4 import java.nio.ByteBuffer;
6 import org.openflow.protocol.OFMatch;
9 * Represents an ofp_flow_stats_request structure
10 * @author David Erickson (daviderickson@cs.stanford.edu)
12 public class OFFlowStatisticsRequest implements OFStatistics, Serializable {
13 protected OFMatch match;
14 protected byte tableId;
15 protected short outPort;
20 public OFMatch getMatch() {
25 * @param match the match to set
27 public void setMatch(OFMatch match) {
34 public byte getTableId() {
39 * @param tableId the tableId to set
41 public void setTableId(byte tableId) {
42 this.tableId = tableId;
48 public short getOutPort() {
53 * @param outPort the outPort to set
55 public void setOutPort(short outPort) {
56 this.outPort = outPort;
60 public int getLength() {
65 public void readFrom(ByteBuffer data) {
66 if (this.match == null)
67 this.match = new OFMatch();
68 this.match.readFrom(data);
69 this.tableId = data.get();
71 this.outPort = data.getShort();
75 public void writeTo(ByteBuffer data) {
76 this.match.writeTo(data);
77 data.put(this.tableId);
79 data.putShort(this.outPort);
83 public int hashCode() {
84 final int prime = 421;
86 result = prime * result + ((match == null) ? 0 : match.hashCode());
87 result = prime * result + outPort;
88 result = prime * result + tableId;
93 public boolean equals(Object obj) {
100 if (!(obj instanceof OFFlowStatisticsRequest)) {
103 OFFlowStatisticsRequest other = (OFFlowStatisticsRequest) obj;
105 if (other.match != null) {
108 } else if (!match.equals(other.match)) {
111 if (outPort != other.outPort) {
114 if (tableId != other.tableId) {