forked from plusone/plusone-commons
修改 PreconditionsExt,添加注释。
This commit is contained in:
@@ -46,7 +46,7 @@ public final class EnumUtil {
|
||||
public static <E extends Enum<?>> E valueOf(Class<E> clazz, int ordinal) {
|
||||
Preconditions.checkNotNull(clazz, "Clazz must not be null.");
|
||||
E[] values = clazz.getEnumConstants();
|
||||
PreconditionsExt.isTrue((ordinal >= 0 && ordinal < values.length),
|
||||
PreconditionsExt.check((ordinal >= 0 && ordinal < values.length),
|
||||
() -> new EnumConstantNotPresentException(clazz, Integer.toString(ordinal)));
|
||||
return values[ordinal];
|
||||
}
|
||||
|
Reference in New Issue
Block a user