I'm looking for the inverse of Supplier<T>
in Guava. I hoped it would be called Consumer
– nope – or Sink
– exists, but is for primitive values.
Is it hidden somewhere and I'm missing it?
I'd like to see it for the same kinds of reasons that Supplier
is useful. Admittedly, uses are less common, but many of the static methods of Suppliers
, for example, would apply in an analogous way, and it would be useful to express in one line things like "send this supplier every value in this iterable".
In the meantime, Predicate
and Function<T,Void>
are ugly workarounds.