public final void setMaxNumber ( final int maxNumber ) { Condition . INSTANCE . ensureGreater ( maxNumber , getMinNumber ( ) , "The maximum number must be greater than the minimum number" ) ; this . maxNumber = maxNumber ; setNumber ( Math . min ( getNumber ( ) , maxNumber ) ) ; }
Sets the maximum number the preference allows to choose .