Create PrivateGroupManager Facade and stub implementation

This commit is contained in:
Torsten Grote
2016-09-28 16:54:28 -03:00
parent 8b50cb1461
commit 6ece398a21
38 changed files with 691 additions and 146 deletions

View File

@@ -0,0 +1,46 @@
package org.briarproject.api.clients;
import org.briarproject.api.sync.Group;
import org.briarproject.api.sync.GroupId;
import org.jetbrains.annotations.NotNull;
public abstract class BaseGroup {
private final Group group;
private final String name;
private final byte[] salt;
public BaseGroup(@NotNull Group group, @NotNull String name, byte[] salt) {
this.group = group;
this.name = name;
this.salt = salt;
}
public GroupId getId() {
return group.getId();
}
public Group getGroup() {
return group;
}
public String getName() {
return name;
}
public byte[] getSalt() {
return salt;
}
@Override
public int hashCode() {
return group.hashCode();
}
@Override
public boolean equals(Object o) {
return o instanceof BaseGroup &&
getGroup().equals(((BaseGroup) o).getGroup());
}
}