Class Try
- java.lang.Object
-
- dev.pcvolkmer.mv64e.datamapper.mapper.exceptionhandler.AbstractLoggable
-
- dev.pcvolkmer.mv64e.datamapper.mapper.exceptionhandler.Try
-
- All Implemented Interfaces:
Catchable
@NullMarked public class Try extends AbstractLoggable implements Catchable
A try/catch chain without any expected result- Since:
- 0.2
-
-
Field Summary
-
Fields inherited from class dev.pcvolkmer.mv64e.datamapper.mapper.exceptionhandler.AbstractLoggable
logger
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TryelseCatch(java.util.function.Consumer<IgnorableMappingException> exceptionConsumer)Consume exception if present.voidelseThrow()Throws exception if present.@Nullable IgnorableMappingExceptiongetException()Get the exception if any.
-
-
-
Method Detail
-
elseThrow
public void elseThrow()
Throws exception if present.
-
elseCatch
public Try elseCatch(java.util.function.Consumer<IgnorableMappingException> exceptionConsumer)
Consume exception if present.- Parameters:
exceptionConsumer- The consumer to be executed with the exception
-
getException
public @Nullable IgnorableMappingException getException()
Get the exception if any.- Specified by:
getExceptionin interfaceCatchable- Returns:
- The exception if any
-
-