mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Renamed user-defined tags "user-defined type identifiers".
This commit is contained in:
@@ -16,7 +16,7 @@ public class AuthorId extends UniqueId {
|
||||
}
|
||||
|
||||
public void writeTo(Writer w) throws IOException {
|
||||
w.writeUserDefinedTag(Tags.AUTHOR_ID);
|
||||
w.writeUserDefinedTag(Types.AUTHOR_ID);
|
||||
w.writeBytes(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class BatchId extends UniqueId {
|
||||
}
|
||||
|
||||
public void writeTo(Writer w) throws IOException {
|
||||
w.writeUserDefinedTag(Tags.BATCH_ID);
|
||||
w.writeUserDefinedTag(Types.BATCH_ID);
|
||||
w.writeBytes(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class GroupId extends UniqueId {
|
||||
}
|
||||
|
||||
public void writeTo(Writer w) throws IOException {
|
||||
w.writeUserDefinedTag(Tags.GROUP_ID);
|
||||
w.writeUserDefinedTag(Types.GROUP_ID);
|
||||
w.writeBytes(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class MessageId extends UniqueId {
|
||||
}
|
||||
|
||||
public void writeTo(Writer w) throws IOException {
|
||||
w.writeUserDefinedTag(Tags.MESSAGE_ID);
|
||||
w.writeUserDefinedTag(Types.MESSAGE_ID);
|
||||
w.writeBytes(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
package net.sf.briar.api.protocol;
|
||||
|
||||
/**
|
||||
* User-defined tags for encoding and decoding protocol objects. An object
|
||||
* should have a user-defined tag if it appears in a list or a map, or if
|
||||
* objects of different types may be encountered in a given protocol state.
|
||||
*/
|
||||
public interface Tags {
|
||||
/** User-defined type identifiers for encoding and decoding protocol objects. */
|
||||
public interface Types {
|
||||
|
||||
static final int ACK = 0;
|
||||
static final int AUTHOR = 1;
|
||||
@@ -18,8 +18,8 @@ public interface Reader {
|
||||
void addConsumer(Consumer c);
|
||||
void removeConsumer(Consumer c);
|
||||
|
||||
void addObjectReader(int tag, ObjectReader<?> o);
|
||||
void removeObjectReader(int tag);
|
||||
void addObjectReader(int id, ObjectReader<?> o);
|
||||
void removeObjectReader(int id);
|
||||
|
||||
boolean hasBoolean() throws IOException;
|
||||
boolean readBoolean() throws IOException;
|
||||
@@ -69,7 +69,7 @@ public interface Reader {
|
||||
boolean hasNull() throws IOException;
|
||||
void readNull() throws IOException;
|
||||
|
||||
boolean hasUserDefined(int tag) throws IOException;
|
||||
<T> T readUserDefined(int tag, Class<T> t) throws IOException;
|
||||
void readUserDefinedTag(int tag) throws IOException;
|
||||
boolean hasUserDefined(int id) throws IOException;
|
||||
<T> T readUserDefined(int id, Class<T> t) throws IOException;
|
||||
void readUserDefinedId(int id) throws IOException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user