@SuppressWarnings("rawtypes")
    private Value objectToValue(Object obj) {
        if (obj instanceof String) {
            return ValueFactory.createRawValue((String) obj);
        } else if (obj instanceof Integer) {
            return ValueFactory.createIntegerValue((Integer) obj);
        } else if (obj instanceof Long) {
            return ValueFactory.createIntegerValue((Long) obj);
        } else if (obj instanceof Map) {
            return mapToValue((Map) obj);
        } else if (obj instanceof List) {
            return listToValue((List) obj);
        } else if (obj instanceof Boolean) {
            return ValueFactory.createBooleanValue((Boolean) obj);
        } else if (obj instanceof Double) {
            return ValueFactory.createFloatValue((Double) obj);
        } else {
            return ValueFactory.createNilValue();
        }
    }