FixedLengthDecorator

data class FixedLengthDecorator(var enabled: Boolean = DEFAULT_ENABLED, var length: Int = DEFAULT_LENGTH, var filler: String = DEFAULT_FILLER) : DecoratorScheme(source)

Forces generated strings to be exactly length characters.

Constructors

Link copied to clipboard
constructor(enabled: Boolean = DEFAULT_ENABLED, length: Int = DEFAULT_LENGTH, filler: String = DEFAULT_FILLER)

Types

Link copied to clipboard
object Companion

Holds constants.

Properties

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

Additional logic that determines how strings are generated.

Link copied to clipboard
var enabled: Boolean

Whether to apply this decorator.

Link copied to clipboard
var filler: String

The character to pad strings that are too short with.

Link copied to clipboard
protected open override val isEnabled: Boolean

Whether this decorator is enabled, or whether any invocation of generateStrings should be passed directly to the generator.

Link copied to clipboard
var length: Int

The enforced length.

Link copied to clipboard
open override val name: String

The name of the scheme as shown to the user.

Functions

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

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>

Generates count random data according to the settings in this scheme, ignoring settings from decorators.