Package eu.bandm.tools.ops
Interface Consumer<D,S>
- Type Parameters:
D
- the parameter typeS
- the acted-upon type
- All Known Subinterfaces:
InitConsumer<D,
S>
public interface Consumer<D,S>
A parametrized action on a stateful class. Action may be by
side-effect modification, cloning derivation or any other
polymorphic technique. The static type of the state object must
not change.
Prototypic instances of consumers are setter methods, I/O write operations and collection updates such as .
-
Method Summary
-
Method Details
-
consume
Act on something.- Type Parameters:
T
- the static type of the state that is invariant under the action- Parameters:
argument
- the parameter valuestate
- the pre-state. This object may be modified if and only if it is also returned.- Returns:
- the post-state, either the same object as
state
or type-equivalent.
-
fold
-