Class Aggregators.AdvancedMinMaxConsumer<V,​T extends Comparable<T>>

  • Type Parameters:
    V - the return value type, for example java.lang.String
    T - the value type for the ordering
    All Implemented Interfaces:
    IItemConsumer<Aggregators.AdvancedMinMaxConsumer<V,​T>>
    Enclosing class:
    Aggregators

    public static class Aggregators.AdvancedMinMaxConsumer<V,​T extends Comparable<T>>
    extends Object
    implements IItemConsumer<Aggregators.AdvancedMinMaxConsumer<V,​T>>
    This consumer separates the attribute for which to do the ordering from the attribute to use for accessing the value. It is typically used within the AdvancedMinMaxAggregator for getting a specific value from the first or last event from a collection of events.
    • Constructor Detail

      • AdvancedMinMaxConsumer

        public AdvancedMinMaxConsumer​(IMemberAccessor<? extends V,​IItem> valueAccessor,
                                      IMemberAccessor<T,​IItem> comparatorAccessor,
                                      boolean max)
        Parameters:
        valueAccessor - the accessor for retrieving the value
        comparatorAccessor - the accessor for retrieving the value to use for comparisons
        max - whether to use the smallest value, or the greatest
    • Method Detail

      • merge

        public Aggregators.AdvancedMinMaxConsumer<V,​T> merge​(Aggregators.AdvancedMinMaxConsumer<V,​T> other)
        Description copied from interface: IItemConsumer
        Merges this object with the supplied object. Normally this is another item consumer of the same type and the output result is a consumer with an internal state that reflects the state of both the current consumer and the input value.
        Specified by:
        merge in interface IItemConsumer<V>
        Parameters:
        other - another instance to merge with
        Returns:
        the merged instance
      • getValue

        public V getValue()