S - the type of the input to the function.T - the type of the result of the function.@FunctionalInterface public interface FunctionOrNull<S,T>
Function, but
with the ability to ignore exceptions. The interface provides a method to
apply a function to a given input, with the provision to throw an exception.
If an exception occurs, the default implementation returns null.| Modifier and Type | Method and Description |
|---|---|
default T |
apply(S source)
Applies this function to the given argument and handles any exceptions.
|
T |
applyWithException(S source)
Applies this function to the given argument, allowing exceptions to be thrown.
|
T applyWithException(S source) throws Exception
source - the function argument.Exception - if an error occurs during function application.Copyright © 2023. All rights reserved.