Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
222 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
hadoop-pcap-lib/src/main/java/net/ripe/hadoop/pcap/packet/Datagram.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package net.ripe.hadoop.pcap.packet; | ||
|
||
import com.google.common.base.Objects; | ||
import com.google.common.collect.ComparisonChain; | ||
|
||
public class Datagram implements Comparable<Datagram> { | ||
private String src; | ||
private String dst; | ||
private Long id; | ||
private String protocol; | ||
|
||
public Datagram(String src, String dst, Long id, String protocol) { | ||
this.src = src; | ||
this.dst = dst; | ||
this.id = id; | ||
this.protocol = protocol; | ||
} | ||
|
||
@Override | ||
public int compareTo(Datagram o) { | ||
return ComparisonChain.start() | ||
.compare(src, o.src) | ||
.compare(dst, o.dst) | ||
.compare(id, o.id) | ||
.compare(protocol, o.protocol) | ||
.result(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return Objects.toStringHelper(this.getClass()).add("src", src) | ||
.add("dst", dst) | ||
.add("id", id) | ||
.add("protocol", protocol) | ||
.toString(); | ||
} | ||
} |
Oops, something went wrong.