Class SingleValueOrContextCollector<T>

  • All Implemented Interfaces:
    java.util.stream.Collector<T,​java.util.List<T>,​java.lang.Object>

    public class SingleValueOrContextCollector<T>
    extends java.lang.Object
    implements java.util.stream.Collector<T,​java.util.List<T>,​java.lang.Object>
    Custom DT collector: it only 1 output, return the output itself. If more than 1 output, return a FEEL Context (hashmap) with name of the output and its value. From the specs: The output expression of a rule in a single output decision table is simply the rule's output entry. The output expression of a multiple output decision table is a context with entries composed from the output names and the rule's corresponding output entries.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.stream.Collector

        java.util.stream.Collector.Characteristics
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.function.BiConsumer<java.util.List<T>,​T> accumulator()  
      java.util.Set<java.util.stream.Collector.Characteristics> characteristics()  
      java.util.function.BinaryOperator<java.util.List<T>> combiner()  
      java.util.function.Function<java.util.List<T>,​java.lang.Object> finisher()  
      java.util.function.Supplier<java.util.List<T>> supplier()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SingleValueOrContextCollector

        public SingleValueOrContextCollector​(java.util.List<java.lang.String> outputNames)
    • Method Detail

      • supplier

        public java.util.function.Supplier<java.util.List<T>> supplier()
        Specified by:
        supplier in interface java.util.stream.Collector<T,​java.util.List<T>,​java.lang.Object>
      • accumulator

        public java.util.function.BiConsumer<java.util.List<T>,​T> accumulator()
        Specified by:
        accumulator in interface java.util.stream.Collector<T,​java.util.List<T>,​java.lang.Object>
      • combiner

        public java.util.function.BinaryOperator<java.util.List<T>> combiner()
        Specified by:
        combiner in interface java.util.stream.Collector<T,​java.util.List<T>,​java.lang.Object>
      • finisher

        public java.util.function.Function<java.util.List<T>,​java.lang.Object> finisher()
        Specified by:
        finisher in interface java.util.stream.Collector<T,​java.util.List<T>,​java.lang.Object>
      • characteristics

        public java.util.Set<java.util.stream.Collector.Characteristics> characteristics()
        Specified by:
        characteristics in interface java.util.stream.Collector<T,​java.util.List<T>,​java.lang.Object>