private static Value getMirrorValue(Object value) {
if (value == null) return null;
if (value instanceof Value) return (Value)value;
Debugger debugger = Debugger.getInstance();
VirtualMachine vm = debugger.getVm();
if (value instanceof Integer) {
return vm.mirrorOf(((Integer)value).intValue());
} else if (value instanceof Boolean) {
return vm.mirrorOf(((Boolean)value).booleanValue());
} else if (value instanceof Float) {
return vm.mirrorOf(((Float)value).floatValue());
} else if (value instanceof Byte) {
return vm.mirrorOf(((Byte)value).byteValue());
} else if (value instanceof Character) {
return vm.mirrorOf(((Character)value).charValue());
} else if (value instanceof Double) {
return vm.mirrorOf(((Double)value).doubleValue());
} else if (value instanceof Long) {
return vm.mirrorOf(((Long)value).longValue());
} else if (value instanceof Short) {
return vm.mirrorOf(((Short)value).shortValue());
} else if (value instanceof String) {
return vm.mirrorOf(((String)value));
}
return null;
}