mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
implement Class.getEnumConstants
This commit is contained in:
@ -345,6 +345,18 @@ public final class Class <T> {
|
||||
}
|
||||
}
|
||||
|
||||
public T[] getEnumConstants() {
|
||||
if (isAssignableFrom(Enum.class)) {
|
||||
try {
|
||||
return (T[]) getMethod("values").invoke(null);
|
||||
} catch (Exception e) {
|
||||
throw new Error();
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public ClassLoader getClassLoader() {
|
||||
return loader;
|
||||
}
|
||||
|
Reference in New Issue
Block a user