mirror of
https://github.com/corda/corda.git
synced 2025-01-22 20:38:05 +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() {
|
public ClassLoader getClassLoader() {
|
||||||
return loader;
|
return loader;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user