NumberSetConstraint

class NumberSetConstraint<T : Number> : Constraint


Represents a set of numbers.

Summary

Public constructors

<T : Number> NumberSetConstraint(
    allowedSet: Set<T>,
    unit: ConstraintUnit?,
    labels: Map<T, List<String>>?
)

Create a NumberSetConstraint instance.

Public properties

Set<T>

The allowed values.

Map<T, List<String>>?

When specified, the key is the allowed value and the value is a list of user-friendly names for that value.

ConstraintUnit?

The measurement unit associated with the number set.

Public constructors

NumberSetConstraint

<T : Number> NumberSetConstraint(
    allowedSet: Set<T>,
    unit: ConstraintUnit?,
    labels: Map<T, List<String>>? = null
)

Create a NumberSetConstraint instance.

Public properties

allowedSet

val allowedSetSet<T>

The allowed values.

labels

val labelsMap<T, List<String>>?

When specified, the key is the allowed value and the value is a list of user-friendly names for that value.

unit

val unitConstraintUnit?

The measurement unit associated with the number set.