Class Collections

java.lang.Object
net.finmath.util.Collections

public class Collections extends Object
Utilities for collections
Author:
Christian Fries
  • Constructor Details

    • Collections

      public Collections()
  • Method Details

    • orderedMapOf

      @SafeVarargs public static <K,V> Map<K,V> orderedMapOf(Map.Entry<K,V>... entries)
      The Java (here Java 11) Map.of implementation does not guarantee that the entrySet retains the ordering, The following implementation generates a map that retains the ordering of the arguments.
      Type Parameters:
      K - Type of the key.
      V - Type of the value.
      Parameters:
      entries - The map entries.
      Returns:
      Map with ordered entries.
    • orderedMapOf

      public static <K,V> Map<K,V> orderedMapOf(Object... keyAndValues)