mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Transport properties client. #229
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package org.briarproject.api;
|
||||
|
||||
import static org.briarproject.api.TransportPropertyConstants.MAX_TRANSPORT_ID_LENGTH;
|
||||
|
||||
/**
|
||||
* Type-safe wrapper for a string that uniquely identifies a transport plugin.
|
||||
*/
|
||||
public class TransportId {
|
||||
|
||||
/** The maximum length of transport identifier in UTF-8 bytes. */
|
||||
public static int MAX_TRANSPORT_ID_LENGTH = 10;
|
||||
|
||||
private final String id;
|
||||
|
||||
public TransportId(String id) {
|
||||
@@ -21,8 +22,7 @@ public class TransportId {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof TransportId) return id.equals(((TransportId) o).id);
|
||||
return false;
|
||||
return o instanceof TransportId && id.equals(((TransportId) o).id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user