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

io.github.cwdesautels.monad.Success 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 Success extends Try {
    @Override
    @Nullable
    T get();

    @Override
    @Value.Auxiliary
    default Exception getCause() {
        throw new UnsupportedOperationException();
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy