LunaChat v1.4.1 : Fixed issue #16.
このコミットが含まれているのは:
1 親
c3e0a32118
コミット
0912c7d7f9
6ファイル変更
+130
-1
検索条件に一致するファイルはありません
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* @author ucchy
|
||||
* @license GPLv3
|
||||
* @copyright Copyright ucchy 2013
|
||||
*/
|
||||
package com.github.ucchyocean.lc;
|
||||
|
||||
|
||||
/**
|
||||
* @author ucchy
|
||||
* NGワードを発言した人に与えるアクションの設定の種類
|
||||
*/
|
||||
public enum NGWordAction {
|
||||
|
||||
/** マスクするのみ */
|
||||
MASK("mask"),
|
||||
|
||||
/** マスクしつつ、チャンネルからキックする */
|
||||
KICK("kick"),
|
||||
|
||||
/** マスクしつつ、チャンネルからBANする */
|
||||
BAN("ban");
|
||||
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* コンストラクタ
|
||||
* @param id ID
|
||||
*/
|
||||
NGWordAction(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 識別文字列を返す
|
||||
* @see java.lang.Enum#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 識別文字列から、NGWordActionを作成して返す。
|
||||
* 無効な文字列が指定された場合は、nullが返される。
|
||||
* @param id 識別文字列
|
||||
* @return 対応したNGWordAction
|
||||
*/
|
||||
public static NGWordAction fromID(String id) {
|
||||
if ( id == null ) {
|
||||
return null;
|
||||
}
|
||||
for (NGWordAction value : values()) {
|
||||
if (id.equalsIgnoreCase(value.id)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする