Result

data class Result<out R>(value: R?, exception: Throwable?)

一个包装了结果和异常的数据类

Constructors

Result
Link copied to clipboard
fun <out R> Result(value: R?, exception: Throwable?)

Functions

component1
Link copied to clipboard
operator fun component1(): R?
component2
Link copied to clipboard
operator fun component2(): Throwable?
copy
Link copied to clipboard
fun copy(value: R?, exception: Throwable?): Result<R>
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
isSuccessful
Link copied to clipboard
fun isSuccessful(): Boolean
如果没有异常,则认为执行成功。并非代表得到了业务需要的值。
toString
Link copied to clipboard
open override fun toString(): String

Properties

exception
Link copied to clipboard
val exception: Throwable?
value
Link copied to clipboard
val value: R?