@Long()

New in 2.0

Generate random long values (8 bytes)

Data TypesSince 2.0.0

Parameters

NameTypeRequiredDefaultDescription
minLong0Minimum value, default 0L (L indicates long type)
maxLong9223372036854775807Maximum value, default 9223372036854775807L
nullSamplerStringThe null ratio, such as "1:2", indicates that generating a random value 3 times with an average of 1 time is null

Usage

@Long(nullWeight)

Generate random long between 0 and 9223372036854775807 with null ratio

Example:
@Long("1:2")
Output:
98089null28907625479
@Long()

Generate random long between 0 and 9223372036854775807

Example:
@Long()
Output:
2567071027
@Long(min,max,nullWeight)

Generate random long between min and max with null ratio

Example:
@Long(-10000L,100000L,)
Output:
198594-17865987637092
@Long(min,max)

Generate random long between min and max

Example:
@Long(1L,10000000000L)
Output:
11093400897887256252199901
← Back to Function Reference