Module com.aoapps.lang
Package com.aoapps.lang
Interface ThrowableSurrogateFactory<Ex extends Throwable>
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ThrowableSurrogateFactory<Ex extends Throwable>
Implements the creation ofThrowablesurrogates.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExnewSurrogate(Ex template, Throwable cause)Creates a newThrowablesurrogate, when possible to create with a compatible state.
-
-
-
Method Detail
-
newSurrogate
Ex newSurrogate(Ex template, Throwable cause)
Creates a newThrowablesurrogate, when possible to create with a compatible state.- Parameters:
template- The created surrogate must be of the same type as the template, and must include all template-type-specific state. If unable to copy the state, then no surrogate should be created.cause- The cause that should be used for the newly created surrogate. This may or may not be the same as the template. This may or may not have the template in its change of causes or suppression lists. It is allowed to further wrap the cause if necessary to create the surrogate, such as withWrappedExceptionorWrappedError.- Returns:
- A new throwable instance of the same type as the template, with compatible state, and the given cause
either directly or wrapped. If unable to create a compatible surrogate, returns
null.
-
-