intellij-randomness / com.fwdekker.randomness.decimal / DecimalSettings

DecimalSettings

data class DecimalSettings : Settings<DecimalSettings>

Contains settings for generating random decimals.

Constructors

<init>

DecimalSettings(minValue: Double = DEFAULT_MIN_VALUE, maxValue: Double = DEFAULT_MAX_VALUE, decimalCount: Int = DEFAULT_DECIMAL_COUNT, showTrailingZeroes: Boolean = DEFAULT_SHOW_TRAILING_ZEROES, groupingSeparator: String = DEFAULT_GROUPING_SEPARATOR, decimalSeparator: String = DEFAULT_DECIMAL_SEPARATOR)

Contains settings for generating random decimals.

Properties

decimalCount

var decimalCount: Int

The number of decimals to display.

decimalSeparator

var decimalSeparator: String

The character that should separate decimals.

groupingSeparator

var groupingSeparator: String

The character that should separate groups.

maxValue

var maxValue: Double

The maximum value to be generated, inclusive.

minValue

var minValue: Double

The minimum value to be generated, inclusive.

showTrailingZeroes

var showTrailingZeroes: Boolean

Whether to include trailing zeroes in the decimals.

Functions

copyState

fun copyState(): DecimalSettings

Returns a shallow copy of this instance.

getState

fun getState(): DecimalSettings

Returns this.

loadState

fun loadState(state: DecimalSettings): Unit

Copies the fields of state to this.

safeSetDecimalSeparator

fun safeSetDecimalSeparator(decimalSeparator: String?): Unit

Sets the decimal separator safely to ensure that exactly one character is set.

safeSetGroupingSeparator

fun safeSetGroupingSeparator(groupingSeparator: String?): Unit

Sets the grouping separator safely to ensure that exactly one character is set.

Companion Object Properties

default

val default: DecimalSettings

The persistent DecimalSettings instance.

DEFAULT_DECIMAL_COUNT

const val DEFAULT_DECIMAL_COUNT: Int

The default value of the decimalCount field.

DEFAULT_DECIMAL_SEPARATOR

const val DEFAULT_DECIMAL_SEPARATOR: String

The default value of the decimalSeparator field.

DEFAULT_GROUPING_SEPARATOR

const val DEFAULT_GROUPING_SEPARATOR: String

The default value of the groupingSeparator field.

DEFAULT_MAX_VALUE

const val DEFAULT_MAX_VALUE: Double

The default value of the maxValue field.

DEFAULT_MIN_VALUE

const val DEFAULT_MIN_VALUE: Double

The default value of the minValue field.

DEFAULT_SHOW_TRAILING_ZEROES

const val DEFAULT_SHOW_TRAILING_ZEROES: Boolean

The default value of the showTrailingZeroes field.