mirror of
https://github.com/corda/corda.git
synced 2025-06-14 13:18:18 +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() {
|
public ClassLoader getClassLoader() {
|
||||||
return loader;
|
return loader;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user