I want to compare two object based on 5-tuple which are: srcAddr, dstAddr, srcPort, dstPort, protocol
here is what i have:
public class Flows implements
Try:
@Override
public int compareTo(final Flows that) {
return ComparisonChain.start().
compare(this.srcAddr, that.srcAddr).
compare(this.dstAddr, that.dstAddr).
compare(this.srcPort, that.srcPort).
compare(this.dstPort, that.dstPort).
compare(this.protocol, that.protocol).
result();
}
Requires Guava