Package-level declarations

Provides basic property state tests, which are (assumed to be) commonly used:

  • Always correct.

  • Not null.

  • Range checks for numbers (Int, Long, Float and Double).

Functions

Link copied to clipboard

If there are no rules a value has to comply with, use this function to obtain state com.zybber.to_state.Correct for it.

Link copied to clipboard
fun isFromInclusiveTo(value: Double, fromValue: Double, toValue: Double): PropertyState<Double>

Check if the Double value is within a range (inclusive from, exclusive to).

fun isFromInclusiveTo(value: Float, fromValue: Float, toValue: Float): PropertyState<Float>

Check if the Float value is within a range (inclusive from, exclusive to).

Link copied to clipboard

Check if the Double value is within a range (inclusive).

Check if the Float value is within a range (inclusive).

Link copied to clipboard
fun isFromTo(value: Double, fromValue: Double, toValue: Double): PropertyState<Double>

Check if the Double value is within a range (exclusive from, exclusive to).

fun isFromTo(value: Float, fromValue: Float, toValue: Float): PropertyState<Float>

Check if the Float value is within a range (exclusive from, exclusive to).

Link copied to clipboard
fun isFromToInclusive(value: Double, fromValue: Double, toValue: Double): PropertyState<Double>

Check if the Double value is within a range (exclusive from, inclusive to).

fun isFromToInclusive(value: Float, fromValue: Float, toValue: Float): PropertyState<Float>

Check if the Float value is within a range (exclusive from, inclusive to).

Link copied to clipboard
fun isGreaterThan(value: Double, otherValue: Double): PropertyState<Double>

Check if the Double value is greater than the given other value.

fun isGreaterThan(value: Float, otherValue: Float): PropertyState<Float>

Check if the Float value is greater than the given other value.

fun isGreaterThan(value: Int, otherValue: Int): PropertyState<Int>

Check if the Int value is greater than the given other value.

fun isGreaterThan(value: Long, otherValue: Long): PropertyState<Long>

Check if the Long value is greater than the given other value.

Link copied to clipboard
fun isLessThan(value: Double, otherValue: Double): PropertyState<Double>

Check if the Double value is less than the given other value.

fun isLessThan(value: Float, otherValue: Float): PropertyState<Float>

Check if the Float value is less than the given other value.

fun isLessThan(value: Int, otherValue: Int): PropertyState<Int>

Check if the Int value is less than the given other value.

fun isLessThan(value: Long, otherValue: Long): PropertyState<Long>

Check if the Long value is less than the given other value.

Link copied to clipboard
fun isNotGreaterThan(value: Double, maximumValue: Double): PropertyState<Double>

Check if the Double value is not greater than the given maximum value.

fun isNotGreaterThan(value: Float, maximumValue: Float): PropertyState<Float>

Check if the Float value is not greater than the given maximum value.

fun isNotGreaterThan(value: Int, maximumValue: Int): PropertyState<Int>

Check if the Int value is not greater than the given maximum value.

fun isNotGreaterThan(value: Long, maximumValue: Long): PropertyState<Long>

Check if the Long value is not greater than the given maximum value.

Link copied to clipboard
fun isNotLessThan(value: Double, minimumValue: Double): PropertyState<Double>

Check if the Double value is not less than the given minimum value.

fun isNotLessThan(value: Float, minimumValue: Float): PropertyState<Float>

Check if the Float value is not less than the given minimum value.

fun isNotLessThan(value: Int, minimumValue: Int): PropertyState<Int>

Check if the Int value is not less than the given minimum value.

fun isNotLessThan(value: Long, minimumValue: Long): PropertyState<Long>

Check if the Long value is not less than the given minimum value.

Link copied to clipboard

Check if the value is not null.

Link copied to clipboard
fun isWithinRange(value: Int, validRange: IntRange): PropertyState<Int>

Check if the Int value is within a range (inclusive).

fun isWithinRange(value: Long, validRange: LongRange): PropertyState<Long>

Check if the Long value is within a range (inclusive).