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

ru.hnau.jutils.producer.extensions.ProducerExtensionsString.kt Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package ru.hnau.jutils.producer.extensions

import ru.hnau.jutils.producer.Producer
import java.util.*


fun Producer.callIfEmpty() = callIf { it.isEmpty() }
fun Producer.callIfBlank() = callIf { it.isBlank() }
fun Producer.callIfNullOrEmpty() = callIf { it.isNullOrEmpty() }
fun Producer.callIfNullOrBlank() = callIf { it.isNullOrBlank() }

fun Producer.filterNotEmpty() = filter { it.isNotEmpty() }
fun Producer.filterNotBlank() = filter { it.isNotBlank() }

fun Producer.toUpperCase() = map { it.toUpperCase() }
fun Producer.toLowerCase() = map { it.toLowerCase() }
fun Producer.toUpperCase(locale: Locale) = map { it.toUpperCase(locale) }
fun Producer.toLowerCase(locale: Locale) = map { it.toLowerCase(locale) }
fun Producer.trim() = map { it.trim() }
fun Producer.trimStart() = map { it.trimStart() }
fun Producer.trimEnd() = map { it.trimEnd() }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy