Made UniqueId a subclass of Bytes.

This commit is contained in:
str4d
2016-02-02 22:00:08 +00:00
committed by akwizgran
parent 0f1dc554bd
commit 5a6ab9bb96
8 changed files with 49 additions and 60 deletions

View File

@@ -3,14 +3,15 @@ package org.briarproject.api.sync;
import org.briarproject.api.UniqueId;
import java.nio.charset.Charset;
import java.util.Arrays;
/**
* Type-safe wrapper for a byte array that uniquely identifies a {@link Group}.
*/
public class GroupId extends UniqueId {
/** Label for hashing groups to calculate their identifiers. */
/**
* Label for hashing groups to calculate their identifiers.
*/
public static final byte[] LABEL =
"GROUP_ID".getBytes(Charset.forName("US-ASCII"));
@@ -20,6 +21,6 @@ public class GroupId extends UniqueId {
@Override
public boolean equals(Object o) {
return o instanceof GroupId && Arrays.equals(id, ((GroupId) o).id);
return o instanceof GroupId && super.equals(o);
}
}