我想写这个模式:
enum Foo {
ABC(SHARED_DATA),
DEF(SHARED_DATA);
GHI(ImmutableList.of(4));
private static final List<Integer> SHARED_DATA = ImmutableList.of(3);
Foo(List<Integer> data) {
this.data = data;
}
public static final List<Integer> data;
}
我保证SHARED_DATA
能及时初始化吗?