File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
mini-common/src/main/java/mini Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ open class Resource<out T> @PublishedApi internal constructor(val value: Any?) {
1616
1717 val isTerminal: Boolean get() = isSuccess || isFailure
1818
19- internal class Empty {
19+ internal object Empty {
2020 override fun toString (): String = " Empty()"
2121 }
2222
@@ -50,7 +50,7 @@ open class Resource<out T> @PublishedApi internal constructor(val value: Any?) {
5050 fun <T > success (value : T ): Resource <T > = Resource (value)
5151 fun <T > failure (exception : Throwable ? = null): Resource <T > = Resource (Failure (exception))
5252 fun <T > loading (value : T ? = null): Resource <T > = Resource (Loading (value))
53- fun <T > empty (): Resource <T > = Resource (Empty () )
53+ fun <T > empty (): Resource <T > = Resource (Empty )
5454 }
5555
5656 override fun toString (): String {
@@ -80,7 +80,7 @@ class Task(value: Any?) : Resource<Unit>(value) {
8080
8181 companion object {
8282 fun success (): Task = Task (Unit )
83- fun idle (): Task = Task (Empty () )
83+ fun idle (): Task = Task (Empty )
8484 fun loading (): Task = Task (Loading <Unit >())
8585 fun failure (exception : Throwable ? = null): Task = Task (Failure (exception))
8686 }
You can’t perform that action at this time.
0 commit comments