Checks if the specified max levels is correct.

@param userMaxLevels the maximum number of levels in the tree
@param defaultMaxLevels the default max number of levels
@return the validated max levels
762106
public static int validateGeohashMaxLevels(Integer userMaxLevels, int defaultMaxLevels) {
        int maxLevels = userMaxLevels == null ? defaultMaxLevels : userMaxLevels;
        if (maxLevels < 1 || maxLevels > GeohashPrefixTree.getMaxLevelsPossible()) {
            throw new IndexException("max_levels must be in range [1, {}], but found {}",
                                     GeohashPrefixTree.getMaxLevelsPossible(),
                                     maxLevels);
        }
        return maxLevels;
    }
1260183
private final int getDefaultIsolationLevel() {
        int defaultIsolationLevel = resRefInfo == null ? Connection.TRANSACTION_NONE : resRefInfo.getIsolationLevel();
        if (defaultIsolationLevel == Connection.TRANSACTION_NONE)
            defaultIsolationLevel = dsConfig.get().isolationLevel;
        if (defaultIsolationLevel == -1)
            defaultIsolationLevel = mcf.getHelper().getDefaultIsolationLevel();
        return defaultIsolationLevel;
    }
978335
public RiakNode setMaxConnections(int maxConnections)
    {
        stateCheck(State.CREATED, State.RUNNING, State.HEALTH_CHECKING);
        if (maxConnections >= getMinConnections())
        {
            permits.setMaxPermits(maxConnections);
        }
        else
        {
            throw new IllegalArgumentException("Max connections less than min connections");
        }
        // TODO: reap delta?
        return this;
    }
1098029
public Integer getMaxAge()
   {
      if (childNode.getTextValueForPatternName("max-age") != null && !childNode.getTextValueForPatternName("max-age").equals("null")) {
         return Integer.valueOf(childNode.getTextValueForPatternName("max-age"));
      }
      return null;
   }
466689
static Map<String, Object> maxPayload(final Object max) {
		if (max == null) {
			return null;
		}
		Map<String, Object> payload = new LinkedHashMap<>();
		payload.put("value", max);
		payload.put("message", MSG_PREFIX + VALIDATORS.get(Max.class));
		return payload;
	}
142093
private double maxScore(List<InetAddress> endpoints)
    {
        double maxScore = -1.0;
        for (InetAddress endpoint : endpoints)
        {
            Double score = scores.get(endpoint);
            if (score == null)
                continue;

            if (score > maxScore)
                maxScore = score;
        }
        return maxScore;
    }
261591
public static Long getValidMaxTotalRows(IndexTuningConfig tuningConfig)
  {
    @Nullable final Integer numShards = tuningConfig.numShards;
    @Nullable final Long maxTotalRows = tuningConfig.maxTotalRows;
    if (numShards == null || numShards == -1) {
      return maxTotalRows == null ? IndexTuningConfig.DEFAULT_MAX_TOTAL_ROWS : maxTotalRows;
    } else {
      return null;
    }
  }
390442
private int getMatchingLevelForNodes(Node n1, Node n2) {
    int count = 0;
    do {
      if (n1.equals(n2)) {
        return count;
      }
      ++count;
      n1 = n1.getParent();
      n2 = n2.getParent();
    } while (n1 != null && n2 != null);
    return this.maxLevel;
  }
1200496
public ValidatorBuilderLong<PARENT> range(long min, long max) {

    return range(new Range<>(Long.valueOf(min), Long.valueOf(max)));
  }
866098
private void checkMarkupLevel(final int markupLevel) {
        if (markupLevel >= this.matchedMarkupLevels.length) {
            final int newLen = Math.max(markupLevel + 1, this.matchedMarkupLevels.length + MATCHED_MARKUP_LEVELS_LEN);
            final boolean[] newMatchedMarkupLevels = new boolean[newLen];
            Arrays.fill(newMatchedMarkupLevels, false);
            System.arraycopy(this.matchedMarkupLevels, 0, newMatchedMarkupLevels, 0, this.matchedMarkupLevels.length);
            this.matchedMarkupLevels = newMatchedMarkupLevels;
        }
    }
508695
private function defaultLevelIsZero(): bool
  {
    return (!empty($this->defaultLevel) && $this->defaultLevel[sizeof($this->defaultLevel) - 1]==0);
  }
29973
@Pure
	public static float max(float... values) {
		if (values == null || values.length == 0) {
			return Float.NaN;
		}
		float max = values[0];
		for (final float v : values) {
			if (v > max) {
				max = v;
			}
		}
		return max;
	}
769693
public void setCacheMaxAges(Map<String, ? extends Number> cacheMaxAges) {
        final Builder<String, Long> cacheMaxAgesBuilder = ImmutableMap.builder();
        final Builder<Long, String> cachedControlStringsBuilder = ImmutableMap.builder();
        final Set<Long> maxAgeLog = new HashSet<Long>();
        
        for (final Map.Entry<String, ? extends Number> cacheMaxAgeEntry : cacheMaxAges.entrySet()) {
            final Number maxAgeNum = cacheMaxAgeEntry.getValue();
            final int maxAge = maxAgeNum.intValue();
            final long maxAgeMillis = TimeUnit.SECONDS.toMillis(maxAge);
            cacheMaxAgesBuilder.put(cacheMaxAgeEntry.getKey(), maxAgeMillis);
            
            if (maxAgeLog.add(maxAgeMillis)) {
                cachedControlStringsBuilder.put(maxAgeMillis, "public, max-age=" + maxAge);
            }
        }
        
        this.cacheMaxAges = cacheMaxAgesBuilder.build();
        this.cachedControlStrings = cachedControlStringsBuilder.build();
    }
1197499
public void setLevels(Level minLevel, Level maxLevel) throws IllegalArgumentException {
        if (minLevel != null && maxLevel != null && minLevel.intValue() > maxLevel.intValue()) {
            throw new IllegalArgumentException("Value of the minLevel parameter should specify level not larger than the value of the maxLevel parametere.");
        }
        this.minLevel = minLevel;
        this.maxLevel = maxLevel;
    }
501386
@Pure
	public static int max(int... values) {
		if (values == null || values.length == 0) {
			return 0;
		}
		int max = values[0];
		for (final int v : values) {
			if (v > max) {
				max = v;
			}
		}
		return max;
	}
437956
public static void setLevel(Level l) {
		for (Logger log : loggers.values()) log.setLevel(l);
		globalLevel = l;
	}
1131399
public function setMaxGradeLevel($maxGradeLevel)
    {
        $maxGradeLevel = (integer) $maxGradeLevel;
        if( $maxGradeLevel )
        {
        	$this->maxGradeLevel = $maxGradeLevel;
        	return true;
        }
        return false;
    }