mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Implement first prototype of GroupMessageValidator
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user