diff --git a/gradle.properties b/gradle.properties index 4d0e3d6..1d57092 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=2.12.0 +projectVersion=2.12.1 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/util/Either.kt b/src/main/kotlin/ru/dbotthepony/kommons/util/Either.kt index 514b29f..5753d3d 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/util/Either.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/util/Either.kt @@ -63,6 +63,10 @@ class Either private constructor(val left: KOptional, val right: KOptio } } + fun swap(): Either { + return Either(right, left) + } + companion object { @JvmStatic fun left(value: L): Either {