-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#9 Started to add JavaDocs for Short API numeric boundaries
- Loading branch information
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,18 +20,30 @@ | |
public class RandomShortApi { | ||
private RandomShortApi() {} | ||
|
||
/** | ||
* @param max inclusive, must be greater than 0 | ||
* @return integer between 0 (inclusive) to {@code max} | ||
*/ | ||
public static int integer(int max) { | ||
return upTo(max).integer(); | ||
} | ||
/** | ||
* @param min inclusive, must be less than {@code max} | ||
* @param max inclusive, must be greater than {@code min} | ||
* @return integer from {@code min} to {@code max} | ||
*/ | ||
public static int integer(int min, int max) { | ||
return between(min, max).integer(); | ||
} | ||
public static int integer() { | ||
return between(Integer.MIN_VALUE, Integer.MAX_VALUE).integer(); | ||
} | ||
|
||
/** @return value between 0 (inclusive) and {@link Integer#MAX_VALUE} (inclusive) */ | ||
public static int positiveInteger() { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ctapobep
Author
Member
|
||
return upTo(Integer.MAX_VALUE).integer(); | ||
} | ||
/** @return value between {@link Long#MIN_VALUE} (inclusive) and {@link Long#MAX_VALUE} (inclusive) */ | ||
public static long Long() { | ||
return between(Long.MIN_VALUE, Long.MAX_VALUE).Long(); | ||
} | ||
|
wow... is zero a positive number? Anyway, it's surprise me.