public List<Report> getReports() { return List.copyOf(reports.values()); }
private static Map<String, List<String>> copyCaseInsensitive(Map<String, List<String>> map) { var newMap = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER); for (var entry : map.entrySet()) { newMap.put(entry.getKey(), List.copyOf(entry.getValue())); } return unmodifiableMap(newMap); }
/** * Create request body send x-www-form-encoded data */ public static Body<List<Param>> wwwForm(Collection<? extends Param> params, Charset charset) { return new FormBody(List.copyOf(requireNonNull(params)), charset); }
/** * Create multi-part encoded request body, from several Parts. */ public static Body<List<Part>> multiPart(List<Part> parts) { return new MultiPartBody(List.copyOf(requireNonNull(parts))); }
public List<Set<Card>> dealHands(Deque<Card> shuffled, int hands, int cardsPerHand) { var result = new ArrayList<Set<Card>>(); for (int i = 0; i < hands; i++) { result.add(this.deal(shuffled, cardsPerHand)); } return List.copyOf(result); }
private Map<Suit,List<Card>> buildCardsAsMapBySuit() { var map = new HashMap<Suit, List<Card>>(); for (var card : this.cards) { Suit suit = card.getSuit(); List<Card> list = map.computeIfAbsent(suit, k -> new ArrayList<>()); list.add(card); } for (var suitListEntry : map.entrySet()) { var value = suitListEntry.getValue(); Collections.sort(value); suitListEntry.setValue(List.copyOf(value)); } return map; }
public CategorySettings copy() { CategorySettings categorySettings = new CategorySettings(); categorySettings.categories = List.copyOf(categories); categorySettings.processToCategoryMap = Map.copyOf(processToCategoryMap); categorySettings.nodeToCategoryMap = nodeToCategoryMap .entrySet() .stream() .map(e -> new AbstractMap.SimpleImmutableEntry<>(e.getKey(), Map.copyOf(e.getValue()))) .collect(Collectors.toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue)); return categorySettings; }
public JDKImperativeDeckOfCardsAsList() { this.cards = List.copyOf(this.buildCardsAsSortedList()); this.cardsBySuit = Map.copyOf(this.buildCardsAsMapBySuit()); }
private void onPhysicsEntityAdded(Entity entity) { if (!jboxWorld.isLocked()) { createBody(entity); } else { delayedBodiesAdd.add(entity); } ChangeListener<Number> scaleChangeListener = (observable, oldValue, newValue) -> { Body b = entity.getComponent(PhysicsComponent.class).body; if (b != null) { List<Fixture> fixtures = List.copyOf(b.getFixtures()); forEach(fixtures, b::destroyFixture); createFixtures(entity); createSensors(entity); } }; // TODO: clean listeners on remove entity.getTransformComponent().scaleXProperty().addListener(scaleChangeListener); entity.getTransformComponent().scaleYProperty().addListener(scaleChangeListener); }
this.interceptorSuppliers = List.copyOf(clientBuilder.interceptorSuppliers);