比較值這裏是我的情況我正在比較WallEnums的兩個情況與其餘的。在枚舉java
import static com.gowallgo.enumtypes.WallEnums.CAW;
"" (and the rest)
/**
* {@link Set} of cancel {@link WallEnums}s
*/
private static final Set<WallEnums> WALL_CODES = asSet(RES, CAW, AAP, ASV, CQP, OQR);
// more stuff and then I use it here .
if (wallEnum != WALL_CODES.contains(wallEnum)){}
這要求重構。我應該在哪裏開始,所以我不需要爲每個代碼進行靜態導入?
你不喜歡什麼? – 2015-02-10 16:00:53
'import static com.gowallgo.enumtypes.WallEnums。*'? – vikingsteve 2015-02-10 16:01:49
使用'Enum.values()'? – meskobalazs 2015-02-10 16:03:46