private String trimValueIfExceedsMaxLength ( String entry , String value ) { if ( value == null ) { return null ; } String result = value ; Integer maximumSize = ENTRY_TO_MAX_SIZE . get ( entry ) ; if ( maximumSize != null && value . length ( ) > maximumSize ) { result = value . substring ( 0 , maximumSize ) ; } return result ; }
If the entry exceeds the maximum length limit associated with the entry its value will be trimmed to meet its limit .