intellij-randomness / com.fwdekker.randomness.array / ArraySettings

ArraySettings

data class ArraySettings : Settings<ArraySettings>

Contains settings for generating arrays of other types of random values.

Constructors

<init>

ArraySettings(count: Int = DEFAULT_COUNT, brackets: String = DEFAULT_BRACKETS, separator: String = DEFAULT_SEPARATOR, isSpaceAfterSeparator: Boolean = DEFAULT_SPACE_AFTER_SEPARATOR)

Contains settings for generating arrays of other types of random values.

Properties

brackets

var brackets: String

The brackets to surround arrays with.

count

var count: Int

The number of elements to generate.

isSpaceAfterSeparator

var isSpaceAfterSeparator: Boolean

True iff a space should be placed after each separator.

separator

var separator: String

The string to place between generated elements.

Functions

arrayify

fun arrayify(strings: Collection<String>): String

Turns a collection of strings into a single string based on the fields of this ArraySettings object.

copyState

fun copyState(): ArraySettings

Returns a shallow copy of this instance.

getState

fun getState(): ArraySettings

Returns this.

loadState

fun loadState(state: ArraySettings): Unit

Copies the fields of state to this.

Companion Object Properties

default

val default: ArraySettings

The persistent ArraySettings instance.

DEFAULT_BRACKETS

const val DEFAULT_BRACKETS: String

The default value of the brackets field.

DEFAULT_COUNT

const val DEFAULT_COUNT: Int

The default value of the count field.

DEFAULT_SEPARATOR

const val DEFAULT_SEPARATOR: String

The default value of the separator field.

DEFAULT_SPACE_AFTER_SEPARATOR

const val DEFAULT_SPACE_AFTER_SEPARATOR: Boolean

The default value of the isSpaceAfterSeparator field.