@SuppressWarnings("rawtypes")
    private String valueString(Object value) {
        if (value == null)
            return null;
        else if (value instanceof String)
            return '"' + quote((String)value) + '"';
        else if (value instanceof Number || value instanceof Boolean || value instanceof Enum)
            return value.toString();
        else if (value instanceof Item)
            return itemReference((Item)value);
        else if (value.getClass().isArray())
            return listString(arrayToList(value).iterator());
        else if ( value instanceof List )
            return listString(((List)value).iterator());
        else if ( value instanceof Set )
            return listString( ((Set)value).iterator());
        else if ( value instanceof Map )
            return mapString((Map)value);
        else
            return '"' + quote(value.toString()) + '"';
    }
Creates a detailed representation of a query tree.

@author Tony Vaagenes
container-search/src/main/java/com/yahoo/prelude/query/textualrepresentation/TextualQueryRepresentation.java