1 package org.openflow.protocol.statistics;
3 import java.nio.ByteBuffer;
5 import org.openflow.protocol.OFMatch;
8 * Represents an ofp_aggregate_stats_request structure
9 * @author David Erickson (daviderickson@cs.stanford.edu)
11 public class OFAggregateStatisticsRequest implements OFStatistics {
12 protected OFMatch match;
13 protected byte tableId;
14 protected short outPort;
19 public OFMatch getMatch() {
24 * @param match the match to set
26 public void setMatch(OFMatch match) {
33 public byte getTableId() {
38 * @param tableId the tableId to set
40 public void setTableId(byte tableId) {
41 this.tableId = tableId;
47 public short getOutPort() {
52 * @param outPort the outPort to set
54 public void setOutPort(short outPort) {
55 this.outPort = outPort;
59 public int getLength() {
64 public void readFrom(ByteBuffer data) {
65 if (this.match == null)
66 this.match = new OFMatch();
67 this.match.readFrom(data);
68 this.tableId = data.get();
70 this.outPort = data.getShort();
74 public void writeTo(ByteBuffer data) {
75 this.match.writeTo(data);
76 data.put(this.tableId);
78 data.putShort(this.outPort);
82 public int hashCode() {
83 final int prime = 401;
85 result = prime * result + ((match == null) ? 0 : match.hashCode());
86 result = prime * result + outPort;
87 result = prime * result + tableId;
92 public boolean equals(Object obj) {
99 if (!(obj instanceof OFAggregateStatisticsRequest)) {
102 OFAggregateStatisticsRequest other = (OFAggregateStatisticsRequest) obj;
104 if (other.match != null) {
107 } else if (!match.equals(other.match)) {
110 if (outPort != other.outPort) {
113 if (tableId != other.tableId) {