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 ; }
Checks if the specified max levels is correct .