MCPcopy Create free account
hub / github.com/DiUS/java-faker / option

Method option

src/main/java/com/github/javafaker/Options.java:19–21  ·  view source on GitHub ↗

Returns a random element from an varargs. @param options The varargs to take a random element from. @param The type of the elements in the varargs. @return A randomly selected element from the varargs.

(E... options)

Source from the content-addressed store, hash-verified

17 * @return A randomly selected element from the varargs.
18 */
19 public <E> E option(E... options) {
20 return options[faker.random().nextInt(options.length)];
21 }
22
23 /**
24 * Returns a random element from Enum.

Callers 11

randomQuoteMethod · 0.80
randomSayingMethod · 0.80
testOptionWithArrayMethod · 0.80
testOptionWithEnumMethod · 0.80
quoteMethod · 0.80
sayingMethod · 0.80
keyMethod · 0.80
chordMethod · 0.80
imeiMethod · 0.80

Calls 2

nextIntMethod · 0.80
randomMethod · 0.45

Tested by 6

randomQuoteMethod · 0.64
randomSayingMethod · 0.64
testOptionWithArrayMethod · 0.64
testOptionWithEnumMethod · 0.64