Class ToUnmodifiable


  • public class ToUnmodifiable
    extends Object
    Utility Collector definitions.
    • Constructor Detail

      • ToUnmodifiable

        public ToUnmodifiable()
    • Method Detail

      • set

        public static <T> Collector<T,​?,​Set<T>> set()
        Collector to unmodifiable Set (maintains insertion order).
        Returns:
        Collector
      • map

        public static <T,​K,​U> Collector<T,​?,​Map<K,​U>> map​(Function<? super T,​? extends K> keyMapper,
                                                                                        Function<? super T,​? extends U> valueMapper)
        Collector to unmodifiable Map.
        Parameters:
        keyMapper -
        valueMapper -
        Returns:
        Collector