T - item typeE - exception typeL - careful loop item handlerpublic class CarelessLoopItemHandler<T,E extends java.lang.Exception,L extends FragileLoopItemHandler<T,E>> extends java.lang.Object implements LoopItemHandler<T>
FragileLoopItemHandler
as a standard LoopItemHandler.
For getting such a handler it's recommended to use
Types.toLoopItemHandler(de.caff.generics.FragileLoopItemHandler).
The wrapper will end the loop (i,e, return false from
LoopItemHandler.handle(Object) if an exception was thrown.
| Constructor and Description |
|---|
CarelessLoopItemHandler(L wrapped)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterFinish()
Called after the loop has finished.
|
void |
beforeStart()
Called before the loop is started.
|
E |
getException()
Get the exception thrown during the last loop.
|
L |
getWrapped()
Get the wrapped careful loop item handler.
|
boolean |
handle(T item)
Handle an item.
|
public boolean handle(T item)
handle in interface LoopItemHandler<T>item - item to handletrue go on with loopfalse break looppublic void beforeStart()
beforeStart in interface LoopHandlerpublic void afterFinish()
afterFinish in interface LoopHandler@NotNull public L getWrapped()