@Documented
@Incubating
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Reducer
Declares that a two-argument combining method is associative and
has an identity element — together, the algebraic contract
a seeded parallel reduction relies on. Equivalent to Associative
plus a declared zero such that combine(zero, a) == a == combine(a, zero).
The zero() member names the identity element as a constant
expression (for example "0", "''", or a fully-qualified
static field reference). When supplied, tooling such as
groovy.typecheckers.CombinerChecker can additionally check that the
seed passed to injectParallel matches the declared identity
where both are statically determinable. An empty value asserts associativity
and the existence of an identity without naming it.
As with Associative, this annotation asserts the laws; it does not prove them. The assertion is intended to be backed by tests.
The identity element, as a constant expression. Empty means the identity exists but is not named (associativity is still asserted).