mirror of
https://github.com/corda/corda.git
synced 2025-01-28 23:24:29 +00:00
add misc methods to classpath
This commit is contained in:
parent
ce97b6eecb
commit
5e42158f4b
@ -12,6 +12,10 @@ public final class Boolean {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Boolean(String s) {
|
||||
this.value = "true".equals(s);
|
||||
}
|
||||
|
||||
public static Boolean valueOf(boolean value) {
|
||||
return (value ? Boolean.TRUE : Boolean.FALSE);
|
||||
}
|
||||
|
@ -12,6 +12,10 @@ public final class Integer extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Integer(String s) {
|
||||
this.value = parseInt(s);
|
||||
}
|
||||
|
||||
public static Integer valueOf(int value) {
|
||||
return new Integer(value);
|
||||
}
|
||||
|
@ -9,6 +9,10 @@ public final class Long extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Long(String s) {
|
||||
this.value = parseLong(s);
|
||||
}
|
||||
|
||||
public static Long valueOf(long value) {
|
||||
return new Long(value);
|
||||
}
|
||||
|
@ -110,4 +110,14 @@ public class Method<T> extends AccessibleObject implements Member {
|
||||
public static native Object invoke(Method method, Object instance,
|
||||
Object ... arguments)
|
||||
throws InvocationTargetException, IllegalAccessException;
|
||||
|
||||
public Class getReturnType() {
|
||||
for (int i = 0; i < spec.length - 1; ++i) {
|
||||
if (spec[i] == ')') {
|
||||
return Class.forCanonicalName
|
||||
(new String(spec, i + 1, spec.length - i - 2, false));
|
||||
}
|
||||
}
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user