mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Changed the root package from net.sf.briar to org.briarproject.
This commit is contained in:
29
briar-api/src/org/briarproject/api/ContactId.java
Normal file
29
briar-api/src/org/briarproject/api/ContactId.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package org.briarproject.api;
|
||||
|
||||
/**
|
||||
* Type-safe wrapper for an integer that uniquely identifies a contact within
|
||||
* the scope of a single node.
|
||||
*/
|
||||
public class ContactId {
|
||||
|
||||
private final int id;
|
||||
|
||||
public ContactId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getInt() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if(o instanceof ContactId) return id == ((ContactId) o).id;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user