All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.cwdesautels.monad.Failure Maven / Gradle / Ivy

package io.github.cwdesautels.monad;

import io.github.cwdesautels.annotation.Nullable;
import org.immutables.value.Value;

@Value.Immutable
@Value.Style(visibility = Value.Style.ImplementationVisibility.PACKAGE)
public interface Failure extends Try {
    @Override
    @Value.Auxiliary
    default T get() {
        throw new RuntimeException(this.getCause());
    }

    @Override
    @Nullable
    Throwable getCause();

    @Override
    default boolean isSuccess() {
        return false;
    }

    @Override
    default boolean isFailure() {
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy