mirror of
https://github.com/corda/corda.git
synced 2025-01-06 21:18:46 +00:00
implement Class.getEnumConstants
This commit is contained in:
parent
4f047ded8c
commit
80f23a5040
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user