Class CollectorUtils

java.lang.Object
io.openems.common.utils.CollectorUtils

public final class CollectorUtils extends Object
  • Method Details

    • toDoubleMap

      public static final <INPUT, FIRST_KEY, SECOND_KEY, VALUE> Collector<INPUT,?,Map<FIRST_KEY,Map<SECOND_KEY,VALUE>>> toDoubleMap(Function<INPUT,FIRST_KEY> firstKeyMapper, Function<INPUT,SECOND_KEY> secondKeyMapper, Function<INPUT,VALUE> valueMapper)
      Creates a Collector which collects the given input to a Map where the value is also a Map.
      Type Parameters:
      INPUT - the input of the collection
      FIRST_KEY - the key of the first map
      SECOND_KEY - the key of the second map
      VALUE - the value of the second map
      Parameters:
      firstKeyMapper - the mapper-function of the first key
      secondKeyMapper - the mapper-function of the second key
      valueMapper - the mapper-function of the value
      Returns:
      the Collector
    • toTreeBasedTable

      public static final <KEY extends Comparable<KEY>, KEY2 extends Comparable<KEY2>, VALUE> Collector<Map.Entry<KEY,Map<KEY2,VALUE>>,?,com.google.common.collect.TreeBasedTable<KEY,KEY2,VALUE>> toTreeBasedTable()
      Creates a Collector which collects the given input to a TreeBasedTable.
      Type Parameters:
      KEY - the type of the first map key
      KEY2 - the type of the second map key
      VALUE - the type of the value
      Returns:
      the Collector