mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-22 08:37:14 +00:00
get back either serializer fun
This commit is contained in:
parent
bc37b11cee
commit
4790fe0aea
@ -27,6 +27,13 @@ sealed interface Either<T1, T2> {
|
||||
@Deprecated("Use optionalT2 instead", ReplaceWith("optionalT2"))
|
||||
val t2: T2?
|
||||
get() = optionalT2.dataOrNull()
|
||||
|
||||
companion object {
|
||||
fun <T1, T2> serializer(
|
||||
t1Serializer: KSerializer<T1>,
|
||||
t2Serializer: KSerializer<T2>,
|
||||
): KSerializer<Either<T1, T2>> = EitherSerializer(t1Serializer, t2Serializer)
|
||||
}
|
||||
}
|
||||
|
||||
class EitherSerializer<T1, T2>(
|
||||
|
Loading…
Reference in New Issue
Block a user