@Override
    public int compareTo(FieldValue fieldValue) {
        int comp = super.compareTo(fieldValue);

        if (comp != 0) {
            return comp;
        }

        //types are equal, this must be of this type
        StringFieldValue otherValue = (StringFieldValue) fieldValue;
        comp = value.compareTo(otherValue.value);

        if (comp != 0) {
            return comp;
        }

        if (spanTrees == null) {
            comp = (otherValue.spanTrees == null) ? 0 : -1;
        } else {
            if (otherValue.spanTrees == null) {
                comp = 1;
            } else {
                comp = CollectionComparator.compare(spanTrees.keySet(), otherValue.spanTrees.keySet());
                if (comp != 0) {
                    return comp;
                }
                comp = CollectionComparator.compare(spanTrees.values(), otherValue.spanTrees.values());
            }
        }
        return comp;
    }
Returns the String value wrapped by this StringFieldValue.

@return the String value wrapped by this StringFieldValue.
document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java