mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Separate the sync layer from its clients. #112
This commit is contained in:
@@ -2,22 +2,25 @@ package org.briarproject.api.identity;
|
||||
|
||||
import org.briarproject.api.UniqueId;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Type-safe wrapper for a byte array that uniquely identifies an
|
||||
* {@link Author}.
|
||||
* {@link org.briarproject.api.identity.Author Author}.
|
||||
*/
|
||||
public class AuthorId extends UniqueId {
|
||||
|
||||
/** Label for hashing authors to calculate their identities. */
|
||||
public static final byte[] LABEL =
|
||||
"AUTHOR_ID".getBytes(Charset.forName("US-ASCII"));
|
||||
|
||||
public AuthorId(byte[] id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof AuthorId)
|
||||
return Arrays.equals(id, ((AuthorId) o).id);
|
||||
return false;
|
||||
return o instanceof AuthorId && Arrays.equals(id, ((AuthorId) o).id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user