com.github.andyshao.util.function.ThrowableToLongFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Gear Show documentation
Show all versions of Gear Show documentation
Enhance and formating the coding of JDK
The newest version!
package com.github.andyshao.util.function;
import com.github.andyshao.lang.Convert;
import com.github.andyshao.util.stream.ThrowableException;
import java.util.function.ToLongFunction;
/**
*
* Title:
* Descript:
* Copyright: Copryright(c) Jun 14, 2019
* Encoding: UNIX UTF-8
*
* @author Andy.Shao
*
* @param argument type
* @see ToLongFunction
* @see ExceptionableToLongFunction
* @deprecated repeated
*/
@Deprecated(since = "5.0.0.RELEASE")
public interface ThrowableToLongFunction {
/**
* apply as long
* @param value input
* @return long value
* @throws Throwable any error
*/
long applyAsLong(T value) throws Throwable;
/**
* to {@link ExceptionableToLongFunction}
* @return {@link ExceptionableToLongFunction}
* @param data type
*/
static Convert, ExceptionableToLongFunction> toExceptionableToLongFunction() {
return input -> {
return t -> {
try {
return input.applyAsLong(t);
} catch (Throwable e) {
throw ThrowableException.convertToException(e);
}
};
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy