Either#swap
This commit is contained in:
parent
efa659a755
commit
eb99d328ac
@ -4,7 +4,7 @@ kotlin.code.style=official
|
|||||||
specifyKotlinAsDependency=false
|
specifyKotlinAsDependency=false
|
||||||
|
|
||||||
projectGroup=ru.dbotthepony.kommons
|
projectGroup=ru.dbotthepony.kommons
|
||||||
projectVersion=2.12.0
|
projectVersion=2.12.1
|
||||||
|
|
||||||
guavaDepVersion=33.0.0
|
guavaDepVersion=33.0.0
|
||||||
gsonDepVersion=2.8.9
|
gsonDepVersion=2.8.9
|
||||||
|
@ -63,6 +63,10 @@ class Either<L, R> private constructor(val left: KOptional<L>, val right: KOptio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun swap(): Either<R, L> {
|
||||||
|
return Either(right, left)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun <L, R> left(value: L): Either<L, R> {
|
fun <L, R> left(value: L): Either<L, R> {
|
||||||
|
Loading…
Reference in New Issue
Block a user