3 Aralık 2019 Salı

ImmutableTable Sınıfı

Örnek
Şöyle yaparız.
ImmutableTable<Region, Country, ImmutableList<City>> immutableTable = RECORDS.stream()
        .collect(toImmutableTable(
                r -> r.getRegion(),
                r -> r.getCountry(),
                r -> ImmutableList.of(r.getCity()),
                (l, l2) -> ImmutableList.<City>builder().addAll(l).addAll(l2).build()
        ));

Hiç yorum yok:

Yorum Gönder