AffixDecorator

data class AffixDecorator(var enabled: Boolean = DEFAULT_ENABLED, var descriptor: String = DEFAULT_DESCRIPTOR) : DecoratorScheme(source)

Decorates a string by adding a prefix and suffix.

Constructors

Link copied to clipboard
constructor(enabled: Boolean = DEFAULT_ENABLED, descriptor: String = DEFAULT_DESCRIPTOR)

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 descriptor: String

The description of the affix. Here, '\' is the escape character (which also escapes itself), and each unescaped '@' is replaced with the original string. If the descriptor does not contain an unescaped '@', then the entire descriptor is placed both in front of and after the original string. For example, affixing "word" with descriptor "(@)" gives "(word)", and affixing "word" with descriptor "()" gives "()word()".

Link copied to clipboard
var enabled: Boolean

Whether to apply this decorator.

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
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): AffixDecorator

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.