mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Made UniqueId a subclass of Bytes.
This commit is contained in:
@@ -2,8 +2,6 @@ package org.briarproject.api.sync;
|
||||
|
||||
import org.briarproject.api.UniqueId;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Type-safe wrapper for a byte array that uniquely identifies a sync client.
|
||||
*/
|
||||
@@ -15,6 +13,6 @@ public class ClientId extends UniqueId {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof ClientId && Arrays.equals(id, ((ClientId) o).id);
|
||||
return o instanceof ClientId && super.equals(o);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ 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
|
||||
@@ -11,7 +10,9 @@ import java.util.Arrays;
|
||||
*/
|
||||
public class MessageId extends UniqueId {
|
||||
|
||||
/** Label for hashing messages to calculate their identifiers. */
|
||||
/**
|
||||
* Label for hashing messages to calculate their identifiers.
|
||||
*/
|
||||
public static final byte[] LABEL =
|
||||
"MESSAGE_ID".getBytes(Charset.forName("US-ASCII"));
|
||||
|
||||
@@ -21,6 +22,6 @@ public class MessageId extends UniqueId {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof MessageId && Arrays.equals(id, ((MessageId) o).id);
|
||||
return o instanceof MessageId && super.equals(o);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user