public class Number extends Object
Modifier and Type | Method and Description |
---|---|
String |
digit() |
String |
digits(int count) |
int |
numberBetween(int min,
int max) |
long |
numberBetween(long min,
long max)
Return a number between min and max.
|
int |
randomDigit()
Returns a random number from 0-9 (both inclusive)
|
int |
randomDigitNotZero()
Returns a random number from 1-9 (both inclusive)
|
double |
randomDouble(int maxNumberOfDecimals,
int min,
int max) |
double |
randomDouble(int maxNumberOfDecimals,
long min,
long max)
Returns a random double
|
long |
randomNumber()
Returns a random number
|
long |
randomNumber(int numberOfDigits,
boolean strict) |
protected Number(Faker faker)
public int randomDigit()
public int randomDigitNotZero()
public int numberBetween(int min, int max)
numberBetween(long, long)
public long numberBetween(long min, long max)
min
- inclusivemax
- exclusive (unless min == max)public long randomNumber(int numberOfDigits, boolean strict)
numberOfDigits
- the number of digits the generated value should havestrict
- whether or not the generated value should have exactly numberOfDigits
public long randomNumber()
public double randomDouble(int maxNumberOfDecimals, int min, int max)
public double randomDouble(int maxNumberOfDecimals, long min, long max)
maxNumberOfDecimals
- maximum number of placesmin
- minimum valuemax
- maximum valuepublic String digits(int count)
public String digit()
Copyright © 2019. All rights reserved.