dependencies { //... implementation 'com.github.dexx:core:0.7.2' } import com.github.dexx.collections.immutable.*; //... public class Main { public static void main(String[] args) { List<String> immutableList = List.of("A", "B", "C"); Set<Integer> immutableSet = Set.of(1, 2, 3); } } import com.github.dexx.collections.immutable.*; //... public class Main { public static void main(String[] args) { List<String> immutableList = List.of("A", "B", "C"); List<String> newList = immutableList.append("D"); List<String> anotherList = newList.remove("B"); List<String> filteredList = anotherList.filter(e -> !e.equals("C")); List<String> updatedList = filteredList.update(0, "X"); } }


上一篇:
下一篇:
切换中文