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

francisco.visintini.pmaxml.presentation.extensions.AnyExt.kt Maven / Gradle / Ivy

Go to download

PimpMyAndroidXML is a command client app that will style/format android xml files. Be aware that is in early stages of development.

There is a newer version: 0.3.6
Show newest version
package francisco.visintini.pmaxml.presentation.extensions

import org.jdom2.Text

/**
 * Checks if [this] is a [String] or a [Text] and if so, returns the result from either
 * [Text.isAllWhitespace] or [String.isAllWhitespace], false otherwise.
 */
fun Any.isAllWhitespace(): Boolean {
    return when (this) {
        is String -> this.isAllWhitespace()
        is Text -> this.isAllWhitespace()
        else -> false
    }
}

/** Negation method from [Any.isAllWhitespace]. */
fun Any.isNotAllWhitespace(): Boolean {
    return !when (this) {
        is String -> this.isAllWhitespace()
        is Text -> this.isAllWhitespace()
        else -> false
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy