public abstract class DeletingFragileLoopItemHandler<T,S> extends java.lang.Object implements FragileLoopItemHandler<S,TypeConverterException>
Modifier and Type | Field and Description |
---|---|
protected T |
deleteMark |
protected Function1<T,S> |
typeConverter |
Modifier | Constructor and Description |
---|---|
protected |
DeletingFragileLoopItemHandler(Function1<T,S> typeConverter,
T deleteMark)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
afterFinish()
Called after the loop has finished.
|
void |
beforeStart()
Called before the loop is started.
|
boolean |
handle(S item)
Handle an item.
|
protected abstract boolean |
handleConverted(T converted,
S incoming)
Handle the converted item.
|
protected final T deleteMark
protected DeletingFragileLoopItemHandler(@NotNull Function1<T,S> typeConverter, @Nullable T deleteMark)
typeConverter
- type converter which converts the incoming types to the collected types.deleteMark
- special value returned by typeConverter
which results in dletion of
the given itemprotected abstract boolean handleConverted(T converted, S incoming) throws java.lang.Exception
converted
- converted itemincoming
- incoming itemtrue
go on with loopfalse
break loopjava.lang.Exception
- if converter throws itpublic boolean handle(S item) throws TypeConverterException
handle
in interface FragileLoopItemHandler<S,TypeConverterException>
item
- item to handletrue
go on with loopfalse
break loopTypeConverterException
- on type conversion errorspublic void beforeStart()
beforeStart
in interface LoopHandler
public void afterFinish()
afterFinish
in interface LoopHandler