Class AggregateTasks.SimpleSum
java.lang.Object
ch.tocco.nice2.persist.core.api.exec.tasks2.AggregateTasks.SimpleSum
- All Implemented Interfaces:
OptionalTask<Iterable<Entity>,
,BigDecimal> PersistTask<Iterable<Entity>,
,BigDecimal> AggregateTasks.AggregateTask<BigDecimal>
- Enclosing class:
AggregateTasks
public static class AggregateTasks.SimpleSum
extends Object
implements OptionalTask<Iterable<Entity>,BigDecimal>, AggregateTasks.AggregateTask<BigDecimal>
Uses a given field name to obtain the value of that field of each entity
in the list to compute the sum. The field must point to a numeric value.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondoRun
(Iterable<Entity> input, CommandContext ctx) static PersistTask
<EntityList, BigDecimal> fromEntityList
(String fieldname) static AggregateTasks.SimpleSum
fromIterable
(String fieldname) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.exec.OptionalTask
run
Methods inherited from interface ch.tocco.nice2.persist.core.api.exec.PersistTask
andThenDo, compose, compose2, composeWhen, discardResult, expand, expand, getDescription, ifElse, orWhen, orWhenNot, passWhen, passWhenNot, skipErrors, unwrap
-
Constructor Details
-
SimpleSum
-
-
Method Details
-
fromEntityList
-
fromIterable
-
doRun
- Specified by:
doRun
in interfaceOptionalTask<Iterable<Entity>,
BigDecimal> - Throws:
Exception
-
fromEntityList
- Specified by:
fromEntityList
in interfaceAggregateTasks.AggregateTask<BigDecimal>
-
toString
-