parent
ed1840a315
commit
3d1e058b59
@ -4,7 +4,7 @@ kotlin.code.style=official
|
||||
specifyKotlinAsDependency=false
|
||||
|
||||
projectGroup=ru.dbotthepony.kommons
|
||||
projectVersion=2.9.18
|
||||
projectVersion=2.9.17
|
||||
|
||||
guavaDepVersion=33.0.0
|
||||
gsonDepVersion=2.8.9
|
||||
|
@ -59,7 +59,7 @@ class KOptional<T> private constructor(private val _value: T, val isPresent: Boo
|
||||
}
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun <E : T> orElse(value: E): T {
|
||||
inline fun orElse(value: T): T {
|
||||
if (isPresent) {
|
||||
return this.value
|
||||
} else {
|
||||
@ -67,7 +67,7 @@ class KOptional<T> private constructor(private val _value: T, val isPresent: Boo
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <E : T> orElse(value: () -> E): T {
|
||||
inline fun orElse(value: () -> T): T {
|
||||
if (isPresent) {
|
||||
return this.value
|
||||
} else {
|
||||
@ -75,11 +75,11 @@ class KOptional<T> private constructor(private val _value: T, val isPresent: Boo
|
||||
}
|
||||
}
|
||||
|
||||
infix fun <E : T> or(value: KOptional<E>): KOptional<T> {
|
||||
infix fun or(value: KOptional<T>): KOptional<T> {
|
||||
if (isPresent) {
|
||||
return this
|
||||
} else {
|
||||
return value as KOptional<T>
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user