Class RandomFunctions
java.lang.Object
org.apache.juneau.commons.svl.functions.RandomFunctions
Random / UUID functions for the
#{...} script catalog.
All rand* functions evaluate per-resolve and are NOT folded by stable-value folding
(stable folding is Var-side only — function evaluation always runs). Use a
Supplier<String> field to get fresh-per-.get() semantics, or a bare
String field to capture once at bean construction.
Cryptographic strength:
RandomFunctions.Rand,RandomFunctions.RandInt,RandomFunctions.RandLong,RandomFunctions.RandString,RandomFunctions.RandChoiceare backed byThreadLocalRandom. Threadsafe; NOT cryptographically secure. Do not use for tokens, secrets, or session ids.RandomFunctions.Uuidis backed byUUID.randomUUID()which usesSecureRandom— cryptographically strong.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class#{rand()}— random double in[0.0, 1.0).static class#{randChoice(option1, option2, ...)}— variadic.static class#{randInt(max)}— random int in[0, max).static class#{randLong(min, max)}— random long in[min, max](inclusive both ends).static class#{randString(length)}— random alphanumeric[A-Za-z0-9]string oflengthcharacters.static class#{uuid()}— random UUID viaUUID.randomUUID(). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class<? extends VarFunction>[]All function classes in this category. -
Method Summary
-
Field Details
-
ALL
All function classes in this category.
-