public static boolean getStringParameter(WebFieldDef fieldDef,
            String paramValue, StringBuilder strBuffer, ProcessResult result) {
        if (TStringUtils.isBlank(paramValue)) {
            result.setFailResult(strBuffer.append("Request miss necessary ")
                    .append(fieldDef.name).append(" data!").toString());
            strBuffer.delete(0, strBuffer.length());
            return result.isSuccess();
        }
        String tmpValue = paramValue.trim();
        if (tmpValue.length() > fieldDef.valMaxLen) {
            result.setFailResult(strBuffer.append(fieldDef.name)
                    .append("'s length over max value, allowed max length is ")
                    .append(fieldDef.valMaxLen).toString());
            strBuffer.delete(0, strBuffer.length());
            return result.isSuccess();
        }
        result.setSuccResult(tmpValue);
        return result.isSuccess();
    }
Check the string parameter

@param fieldDef  the field to be checked
@param paramValue the field value to be checked
@param strBuffer the string pool construct the result
@param result    the checked result
@return result success or failure
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/paramcheck/PBParameterUtils.java