private void checkLimitRange ( int limit ) { int minLimit = offsetPaginationConfiguration . allowZeroLimit ( ) ? 0 : 1 ; if ( limit < minLimit || limit > offsetPaginationConfiguration . maxLimit ( ) ) { throw InvalidParameterException . create ( "Invalid value for '" + this . getParameterFieldName ( ) + "': " + limit + " - value between " + minLimit + " and " + offsetPaginationConfiguration . maxLimit ( ) + " is required." ) ; } }
Ensures that the limit is in the allowed range .