private static String validateTextString(String value) {
        if ( ! Text.isValidTextString(value)) {
            if (replaceInvalidUnicode) return Text.stripInvalidCharacters(value);
            else throw new IllegalArgumentException("The string field value contains illegal code point 0x" +
                                                    Integer.toHexString(Text.validateTextString(value).getAsInt()).toUpperCase());
        }
        return value;
    }
Creates a new StringFieldValue with the given value.

@param value the value to wrap.
@throws IllegalArgumentException if the string contains non-text characters as defined by 
                                 {@link Text#isTextCharacter(int)}
document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java