mirror of
https://github.com/corda/corda.git
synced 2025-06-13 20:58:19 +00:00
add misc methods to classpath
This commit is contained in:
@ -12,6 +12,10 @@ public final class Boolean {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean(String s) {
|
||||||
|
this.value = "true".equals(s);
|
||||||
|
}
|
||||||
|
|
||||||
public static Boolean valueOf(boolean value) {
|
public static Boolean valueOf(boolean value) {
|
||||||
return (value ? Boolean.TRUE : Boolean.FALSE);
|
return (value ? Boolean.TRUE : Boolean.FALSE);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,10 @@ public final class Integer extends Number {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer(String s) {
|
||||||
|
this.value = parseInt(s);
|
||||||
|
}
|
||||||
|
|
||||||
public static Integer valueOf(int value) {
|
public static Integer valueOf(int value) {
|
||||||
return new Integer(value);
|
return new Integer(value);
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,10 @@ public final class Long extends Number {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long(String s) {
|
||||||
|
this.value = parseLong(s);
|
||||||
|
}
|
||||||
|
|
||||||
public static Long valueOf(long value) {
|
public static Long valueOf(long value) {
|
||||||
return new 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,
|
public static native Object invoke(Method method, Object instance,
|
||||||
Object ... arguments)
|
Object ... arguments)
|
||||||
throws InvocationTargetException, IllegalAccessException;
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user