public static String trimToMaximumLengthAllowed(String string) {
    if (string != null && string.length() > DB_MAX_STRING_LENGTH) {
      return string.substring(0, DB_MAX_STRING_LENGTH);
    }
    return string;
  }
public static String trimToMaximumLengthAllowed ( String string ) { if ( string != null && string . length ( ) > DB_MAX_STRING_LENGTH ) { return string . substring ( 0 , DB_MAX_STRING_LENGTH ) ; } return string ; }
Trims the input to the {@link #DB_MAX_STRING_LENGTH maxium length allowed} for persistence with our default database schema

@param string the input that might be trimmed if maximum length is exceeded
@return the input, eventually trimmed to {@link #DB_MAX_STRING_LENGTH}