mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
flesh out serialization/deserialization code and fix build
This commit is contained in:
@ -12,6 +12,10 @@ public final class Boolean {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Boolean valueOf(boolean value) {
|
||||
return (value ? Boolean.TRUE : Boolean.FALSE);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Boolean && ((Boolean) o).value == value;
|
||||
}
|
||||
|
@ -9,6 +9,10 @@ public final class Byte extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Byte valueOf(byte value) {
|
||||
return new Byte(value);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Byte && ((Byte) o).value == value;
|
||||
}
|
||||
|
@ -9,6 +9,10 @@ public final class Character {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Character valueOf(char value) {
|
||||
return new Character(value);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Character && ((Character) o).value == value;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public final class Class <T> {
|
||||
|
||||
private native void initialize();
|
||||
|
||||
static Class forCanonicalName(String name) {
|
||||
public static Class forCanonicalName(String name) {
|
||||
try {
|
||||
if (name.startsWith("[")) {
|
||||
return forName(name);
|
||||
@ -65,6 +65,14 @@ public final class Class <T> {
|
||||
}
|
||||
}
|
||||
|
||||
public Class getComponentType() {
|
||||
if (isArray()) {
|
||||
return forCanonicalName(new String(name, 1, name.length - 2, false));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public native boolean isAssignableFrom(Class c);
|
||||
|
||||
private Field findField(String name) {
|
||||
|
@ -13,6 +13,10 @@ public final class Double extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Double valueOf(double value) {
|
||||
return new Double(value);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Double && ((Double) o).value == value;
|
||||
}
|
||||
|
@ -9,6 +9,10 @@ public final class Float extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Float valueOf(float value) {
|
||||
return new Float(value);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Float && ((Float) o).value == value;
|
||||
}
|
||||
|
@ -12,6 +12,10 @@ public final class Integer extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Integer valueOf(int value) {
|
||||
return new Integer(value);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Integer && ((Integer) o).value == value;
|
||||
}
|
||||
|
@ -9,6 +9,10 @@ public final class Long extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Long valueOf(long value) {
|
||||
return new Long(value);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Long && ((Long) o).value == value;
|
||||
}
|
||||
|
@ -9,6 +9,10 @@ public final class Short extends Number {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static Short valueOf(short value) {
|
||||
return new Short(value);
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Short && ((Short) o).value == value;
|
||||
}
|
||||
|
@ -29,6 +29,8 @@ public abstract class System {
|
||||
|
||||
public static native long currentTimeMillis();
|
||||
|
||||
public static native int identityHashCode(Object o);
|
||||
|
||||
public static void loadLibrary(String name) {
|
||||
Runtime.getRuntime().loadLibrary(name);
|
||||
}
|
||||
|
@ -31,6 +31,10 @@ public class Field<T> extends AccessibleObject {
|
||||
return new String(name, 0, name.length - 1, false);
|
||||
}
|
||||
|
||||
public Class getType() {
|
||||
return Class.forCanonicalName(getName());
|
||||
}
|
||||
|
||||
public native Object get(Object instance);
|
||||
|
||||
public native void set(Object instance, Object value);
|
||||
|
Reference in New Issue
Block a user