IntegerScheme

data class IntegerScheme(var minValue: Long = DEFAULT_MIN_VALUE, var maxValue: Long = DEFAULT_MAX_VALUE, var base: Int = DEFAULT_BASE, var isUppercase: Boolean = DEFAULT_IS_UPPERCASE, var groupingSeparatorEnabled: Boolean = DEFAULT_GROUPING_SEPARATOR_ENABLED, var groupingSeparator: String = DEFAULT_GROUPING_SEPARATOR, val fixedLengthDecorator: FixedLengthDecorator = DEFAULT_FIXED_LENGTH_DECORATOR, val affixDecorator: AffixDecorator = DEFAULT_AFFIX_DECORATOR, val arrayDecorator: ArrayDecorator = DEFAULT_ARRAY_DECORATOR) : Scheme(source)

Contains settings for generating random integers.

Constructors

Link copied to clipboard
constructor(minValue: Long = DEFAULT_MIN_VALUE, maxValue: Long = DEFAULT_MAX_VALUE, base: Int = DEFAULT_BASE, isUppercase: Boolean = DEFAULT_IS_UPPERCASE, groupingSeparatorEnabled: Boolean = DEFAULT_GROUPING_SEPARATOR_ENABLED, groupingSeparator: String = DEFAULT_GROUPING_SEPARATOR, fixedLengthDecorator: FixedLengthDecorator = DEFAULT_FIXED_LENGTH_DECORATOR, affixDecorator: AffixDecorator = DEFAULT_AFFIX_DECORATOR, arrayDecorator: ArrayDecorator = DEFAULT_ARRAY_DECORATOR)

Types

Link copied to clipboard
object Companion

Holds constants.

Properties

Link copied to clipboard

The affixation to apply to the generated values.

Link copied to clipboard

Settings that determine whether the output should be an array of values.

Link copied to clipboard
var base: Int

The base the generated value should be displayed in.

Link copied to clipboard
open override val decorators: List<DecoratorScheme>

Additional logic that determines how strings are generated.

Link copied to clipboard

Settings that determine whether the output should be fixed to a specific length.

Link copied to clipboard
var groupingSeparator: String

The character that should separate groups if groupingSeparatorEnabled is true.

Link copied to clipboard

true if and only if the groupingSeparator should be applied.

Link copied to clipboard
var isUppercase: Boolean

true if and only if all letters are uppercase.

Link copied to clipboard
var maxValue: Long

The maximum value to be generated, inclusive.

Link copied to clipboard
var minValue: Long

The minimum value to be generated, inclusive.

Link copied to clipboard
open override val name: String

The name of the scheme as shown to the user.

Link copied to clipboard
open override val typeIcon: TypeIcon

The icon signifying the type of data represented by this scheme, ignoring its decorators, or null if this scheme does not represent any kind of data, as is the case for DecoratorSchemes.

Functions

Link copied to clipboard
open override fun deepCopy(retainUuid: Boolean): IntegerScheme

Returns a deep copy, retaining the uuid if and only if retainUuid is true.

Link copied to clipboard
open override fun doValidate(): String?

Validates the state, and indicates whether and why it is invalid.

Link copied to clipboard
protected open override fun generateUndecoratedStrings(count: Int): List<String>

Returns count random formatted integers from minValue (inclusive) to maxValue (inclusive).

Link copied to clipboard
private fun longToString(value: Long): String

Returns a nicely formatted representation of value.

Link copied to clipboard
private fun randomLong(from: Long, until: Long): Long

Returns a random long in the range from from (inclusive) to until (inclusive) without causing overflow.