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

com.machinezoo.noexception.optional.FallbackDoubleToLongFunction Maven / Gradle / Ivy

Go to download

Makes exception handling concise and beautiful, yet architecturally clean and flexible.

There is a newer version: 1.9.1
Show newest version
// Part of NoException: https://noexception.machinezoo.com
// Generated code. Edit generate.py instead.
package com.machinezoo.noexception.optional;

import java.util.function.*;

final class FallbackDoubleToLongFunction implements DoubleToLongFunction {
	private final OptionalDoubleToLongFunction inner;
	private final LongSupplier source;
	public FallbackDoubleToLongFunction(OptionalDoubleToLongFunction inner, LongSupplier source) {
		this.inner = inner;
		this.source = source;
	}
	@Override public long applyAsLong(double value) {
		return inner.apply(value).orElseGet(source);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy