public final void setMaxNumberOfCharacters ( final int maxNumberOfCharacters ) { if ( maxNumberOfCharacters != - 1 ) { Condition . INSTANCE . ensureAtLeast ( maxNumberOfCharacters , 1 , "The maximum number of characters must be at least 1" ) ; } this . maxNumberOfCharacters = maxNumberOfCharacters ; adaptMaxNumberOfCharactersMessage ( ) ; }
Sets the maximum number of characters the edit text should be allowed to contain .