@Override
    public void assign(Object o) {
        if (spanTrees != null) {
            spanTrees.clear();
            spanTrees = null;
        }

        if (!checkAssign(o)) {
            return;
        }
        if (o instanceof StringFieldValue) {
            spanTrees=((StringFieldValue)o).spanTrees;
        }
        if (o instanceof String) {
            setValue((String) o);
        } else if (o instanceof StringFieldValue || o instanceof NumericFieldValue) {
            setValue(o.toString());
        } else {
            throw new IllegalArgumentException("Class " + o.getClass() + " not applicable to an " + this.getClass() + " instance.");
        }
    }
Sets a new value for this StringFieldValue. NOTE that doing so will clear all span trees from this value,
since they most certainly will not make sense for a new string value.

@param o the new String to assign to this. An argument of null is equal to calling clear().
@throws IllegalArgumentException if the given argument is a string containing non-text characters as defined by 
                                 {@link Text#isTextCharacter(int)}
document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java