Implement first prototype of GroupMessageValidator

This commit is contained in:
Torsten Grote
2016-10-18 14:28:21 -02:00
parent 8dc529cc3f
commit a6e3827127
5 changed files with 205 additions and 15 deletions

View File

@@ -0,0 +1,30 @@
package org.briarproject.api.privategroup;
public enum MessageType {
NEW_MEMBER(0),
JOIN(1),
POST(2);
int value;
MessageType(int value) {
this.value = value;
}
public static MessageType valueOf(int value) {
switch (value) {
case 0:
return NEW_MEMBER;
case 1:
return JOIN;
case 2:
return POST;
default:
throw new IllegalArgumentException();
}
}
public int getInt() {
return value;
}
}