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

com.machinezoo.noexception.optional.FallbackLongToIntFunction 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
package com.machinezoo.noexception.optional;

import java.util.function.*;
import lombok.*;

@RequiredArgsConstructor final class FallbackLongToIntFunction implements LongToIntFunction {
	private final OptionalLongToIntFunction inner;
	private final IntSupplier source;
	@Override public int applyAsInt(long value) {
		return inner.apply(value).orElseGet(source);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy