Class ImmutableCollectors


  • public class ImmutableCollectors
    extends Object
    Set of convenient function regarding a collection immutability. Particularly useful in the conjunction with Stream.
    • Constructor Detail

      • ImmutableCollectors

        public ImmutableCollectors()
    • Method Detail

      • toImmutableLinkedSet

        public static <T> Collector<T,​Set<T>,​Set<T>> toImmutableLinkedSet()
        Creates a Collector of an immutable Set for Stream.collect(Collector).
        Type Parameters:
        T - type of the immutable linked hash set.
        Returns:
        collector for immutable linked hash set.