com.github.tonivade.purefun.CheckedProducer Maven / Gradle / Ivy
/*
* Copyright (c) 2018-2019, Antonio Gabriel Muñoz Conejo
* Distributed under the terms of the MIT License
*/
package com.github.tonivade.purefun;
import com.github.tonivade.purefun.type.Either;
import com.github.tonivade.purefun.type.Option;
import com.github.tonivade.purefun.type.Try;
@FunctionalInterface
public interface CheckedProducer extends Recoverable {
A get() throws Throwable;
default CheckedFunction1 asFunction() {
return value -> get();
}
default Producer> liftTry() {
return () -> Try.of(this);
}
default Producer © 2015 - 2025 Weber Informatics LLC | Privacy Policy