Skip to content

Instantly share code, notes, and snippets.

@Ahnfelt
Created October 10, 2012 14:57
Show Gist options
  • Save Ahnfelt/3866153 to your computer and use it in GitHub Desktop.
Save Ahnfelt/3866153 to your computer and use it in GitHub Desktop.
package com.infopaq.research.flow.common;
import java.util.Arrays;
public class ByteId {
private final byte[] bytes;
public ByteId(byte[] bytes) {
this.bytes = bytes;
}
public byte[] getBytes() {
return bytes;
}
public boolean equals(Object that) {
if(that instanceof ByteId) {
return Arrays.equals(bytes, ((ByteId) that).bytes);
} else {
return false;
}
}
public int hashCode() {
return Arrays.hashCode(bytes);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment