Tabnine Logo
List.copyOf
Code IndexAdd Tabnine to your IDE (free)

How to use
copyOf
method
in
java.util.List

Best Java code snippets using java.util.List.copyOf (Showing top 10 results out of 315)

origin: com.yahoo.vespa/node-repository

public List<Report> getReports() { return List.copyOf(reports.values()); }
origin: net.dongliu/xhttp

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);
}
origin: net.dongliu/xhttp

/**
 * 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);
}
origin: net.dongliu/xhttp

/**
 * 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)));
}
origin: BNYMellon/CodeKatas

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);
}
origin: BNYMellon/CodeKatas

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;
}
origin: com.github.tornaia/aott-desktop-client-core

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;
}
origin: BNYMellon/CodeKatas

public JDKImperativeDeckOfCardsAsList()
{
  this.cards = List.copyOf(this.buildCardsAsSortedList());
  this.cardsBySuit = Map.copyOf(this.buildCardsAsMapBySuit());
}
origin: com.github.almasb/fxgl-entity

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);
}
origin: net.dongliu/xhttp

this.interceptorSuppliers = List.copyOf(clientBuilder.interceptorSuppliers);
java.utilListcopyOf

Popular methods of List

  • add
  • size
    Returns the number of elements in this List.
  • get
    Returns the element at the specified location in this List.
  • isEmpty
    Returns whether this List contains no elements.
  • addAll
  • toArray
    Returns an array containing all elements contained in this List. If the specified array is large eno
  • contains
    Tests whether this List contains the specified object.
  • remove
    Removes the first occurrence of the specified object from this List.
  • iterator
    Returns an iterator on the elements of this List. The elements are iterated in the same order as the
  • clear
  • stream
  • forEach
  • stream,
  • forEach,
  • set,
  • subList,
  • indexOf,
  • equals,
  • hashCode,
  • removeAll,
  • listIterator,
  • sort

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now