com.machinezoo.noexception.optional.FallbackLongSupplier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of noexception Show documentation
Show all versions of noexception Show documentation
Functional programming for exception handlers.
// Part of NoException: https://noexception.machinezoo.com
package com.machinezoo.noexception.optional;
import java.util.function.*;
import lombok.*;
@RequiredArgsConstructor final class FallbackLongSupplier implements LongSupplier {
private final OptionalLongSupplier inner;
private final LongSupplier source;
@Override public long getAsLong() {
return inner.get().orElseGet(source);
}
}