diff --git a/noty-android/core/src/main/java/dev/shreyaspatil/noty/core/ui/UIDataState.kt b/noty-android/core/src/main/java/dev/shreyaspatil/noty/core/ui/UIDataState.kt deleted file mode 100644 index af8864b4..00000000 --- a/noty-android/core/src/main/java/dev/shreyaspatil/noty/core/ui/UIDataState.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2020 Shreyas Patil - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package dev.shreyaspatil.noty.core.ui - -/** - * State for UI containing data. - */ -sealed class UIDataState { - class Loading : UIDataState() - class Success(val data: T) : UIDataState() - class Failed(val message: String) : UIDataState() - - val isLoading get() = this is Loading - - val isSuccess get() = this is Success - - val isFailed get() = this is Failed - - companion object { - fun loading() = Loading() - fun success(data: T) = Success(data) - fun failed(message: String) = Failed(message) - } -}