Class CollectionUtils

java.lang.Object
de.bwaldvogel.mongo.backend.CollectionUtils

public final class CollectionUtils
extends java.lang.Object
  • Method Summary

    Modifier and Type Method Description
    static <T> T getLastElement​(java.util.List<T> list)  
    static <T> T getSingleElement​(java.lang.Iterable<T> iterable)  
    static <T> T getSingleElement​(java.lang.Iterable<T> iterable, java.util.function.Supplier<? extends java.lang.RuntimeException> exceptionSupplier)  
    static <T extends java.util.Map<K,​ ?>,​ K>
    T
    removeAll​(T map, java.util.Collection<K> keysToRemove)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getSingleElement

      public static <T> T getSingleElement​(java.lang.Iterable<T> iterable)
    • getLastElement

      public static <T> T getLastElement​(java.util.List<T> list)
    • getSingleElement

      public static <T> T getSingleElement​(java.lang.Iterable<T> iterable, java.util.function.Supplier<? extends java.lang.RuntimeException> exceptionSupplier)
    • removeAll

      public static <T extends java.util.Map<K,​ ?>,​ K> T removeAll​(T map, java.util.Collection<K> keysToRemove)