All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.screenplay.ensure.DescriptionOf.kt Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package net.serenitybdd.screenplay.ensure

fun  descriptionOf(value: KnowableValue): String {
    when(value) {
        is KnowableBooleanValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableBooleanAnswer -> {
            return value.description
        }
        is KnowableStringValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableStringAnswer -> {
            return value.description
        }
        is KnowableBigDecimalValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableDoubleValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableFloatValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableIntValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableLocalDateValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableLocalTimeValue<*> -> {
            if (value.value is HasSubject) {
                return value.value.subject()
            }
        }
        is KnowableComparableAnswer -> {
            return value.description
        }
    }
    return "a value"
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy