com.github.tonivade.purefun.Producer 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 Producer {
T get();
default Function1 asFunction() {
return value -> get();
}
default Producer andThen(Function1 after) {
return () -> after.apply(get());
}
default Producer © 2015 - 2025 Weber Informatics LLC | Privacy Policy