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

How to use
addAll
method
in
java.util.List

Best Java code snippets using java.util.List.addAll (Showing top 20 results out of 163,152)

Refine searchRefine arrow

  • List.add
  • List.size
  • Arrays.asList
  • List.isEmpty
  • List.get
  • Map.put
  • List.toArray
origin: spring-projects/spring-framework

/**
 * Configure one or more factories to decorate the handler used to process
 * WebSocket messages. This may be useful in some advanced use cases, for
 * example to allow Spring Security to forcibly close the WebSocket session
 * when the corresponding HTTP session expires.
 * @since 4.1.2
 */
public WebSocketTransportRegistration setDecoratorFactories(WebSocketHandlerDecoratorFactory... factories) {
  this.decoratorFactories.addAll(Arrays.asList(factories));
  return this;
}
origin: skylot/jadx

public List<RegisterArg> getArguments(boolean includeThis) {
  if (includeThis && thisArg != null) {
    List<RegisterArg> list = new ArrayList<>(argsList.size() + 1);
    list.add(thisArg);
    list.addAll(argsList);
    return list;
  }
  return argsList;
}
origin: google/guava

public static void assertContainsAllOf(Iterable<?> actual, Object... expected) {
 List<Object> expectedList = new ArrayList<>();
 expectedList.addAll(Arrays.asList(expected));
 for (Object o : actual) {
  expectedList.remove(o);
 }
 if (!expectedList.isEmpty()) {
  Assert.fail("Not true that " + actual + " contains all of " + Arrays.asList(expected));
 }
}
origin: ch.qos.logback/logback-classic

protected Class[] getParameterTypes() {
  List<Class> fullTypeList = new ArrayList<Class>();
  fullTypeList.addAll(DEFAULT_PARAM_TYPE_LIST);
  for (int i = 0; i < matcherList.size(); i++) {
    fullTypeList.add(Matcher.class);
  }
  return (Class[]) fullTypeList.toArray(CoreConstants.EMPTY_CLASS_ARRAY);
}
origin: square/okhttp

/** Returns a snapshot of the calls currently being executed. */
public synchronized List<Call> runningCalls() {
 List<Call> result = new ArrayList<>();
 result.addAll(runningSyncCalls);
 for (AsyncCall asyncCall : runningAsyncCalls) {
  result.add(asyncCall.get());
 }
 return Collections.unmodifiableList(result);
}
origin: square/okhttp

 /**
  * Returns an immutable map containing each field to its list of values.
  *
  * @param valueForNullKey the request line for requests, or the status line for responses. If
  * non-null, this value is mapped to the null key.
  */
 public static Map<String, List<String>> toMultimap(Headers headers, String valueForNullKey) {
  Map<String, List<String>> result = new TreeMap<>(FIELD_NAME_COMPARATOR);
  for (int i = 0, size = headers.size(); i < size; i++) {
   String fieldName = headers.name(i);
   String value = headers.value(i);

   List<String> allValues = new ArrayList<>();
   List<String> otherValues = result.get(fieldName);
   if (otherValues != null) {
    allValues.addAll(otherValues);
   }
   allValues.add(value);
   result.put(fieldName, Collections.unmodifiableList(allValues));
  }
  if (valueForNullKey != null) {
   result.put(null, Collections.unmodifiableList(Collections.singletonList(valueForNullKey)));
  }
  return Collections.unmodifiableMap(result);
 }
}
origin: jenkinsci/jenkins

public ProcStarter cmds(File program, String... args) {
  commands = new ArrayList<String>(args.length+1);
  commands.add(program.getPath());
  commands.addAll(Arrays.asList(args));
  return this;
}
origin: androidannotations/androidannotations

private List<String> updateLocations(String path, List<String> possibleLocations) {
  List<String> knownLocations = new ArrayList<>();
  for (String location : possibleLocations) {
    String expectedLocation = path + "/" + location;
    File file = new File(expectedLocation + "/output.json");
    if (file.exists()) {
      Matcher matcher = OUTPUT_JSON_PATTERN.matcher(readJsonFromFile(file));
      if (matcher.matches()) {
        String relativeManifestPath = matcher.group(1);
        File manifestFile = new File(expectedLocation + "/" + relativeManifestPath);
        String manifestDirectory = manifestFile.getParentFile().getAbsolutePath();
        knownLocations.add(manifestDirectory.substring(path.length()));
      }
    }
  }
  if (knownLocations.isEmpty()) {
    knownLocations.addAll(possibleLocations);
  }
  return knownLocations;
}
origin: spring-projects/spring-framework

/**
 * Parse the given list of (potentially) comma-separated strings into a
 * list of {@code MediaType} objects.
 * <p>This method can be used to parse an Accept or Content-Type header.
 * @param mediaTypes the string to parse
 * @return the list of media types
 * @throws InvalidMediaTypeException if the media type value cannot be parsed
 * @since 4.3.2
 */
public static List<MediaType> parseMediaTypes(@Nullable List<String> mediaTypes) {
  if (CollectionUtils.isEmpty(mediaTypes)) {
    return Collections.emptyList();
  }
  else if (mediaTypes.size() == 1) {
    return parseMediaTypes(mediaTypes.get(0));
  }
  else {
    List<MediaType> result = new ArrayList<>(8);
    for (String mediaType : mediaTypes) {
      result.addAll(parseMediaTypes(mediaType));
    }
    return result;
  }
}
origin: spring-projects/spring-framework

arguments.add(getResolvableField(objectName, field));
      attributeValue = new ResolvableAttribute(attributeValue.toString());
    attributesToExpose.put(attributeName, attributeValue);
arguments.addAll(attributesToExpose.values());
return arguments.toArray();
origin: spring-projects/spring-framework

private static Map<Class<? extends Throwable>, Method> initExceptionMappings(Class<?> handlerType) {
  Map<Method, MessageExceptionHandler> methods = MethodIntrospector.selectMethods(handlerType,
      (MethodIntrospector.MetadataLookup<MessageExceptionHandler>) method ->
          AnnotatedElementUtils.findMergedAnnotation(method, MessageExceptionHandler.class));
  Map<Class<? extends Throwable>, Method> result = new HashMap<>();
  for (Map.Entry<Method, MessageExceptionHandler> entry : methods.entrySet()) {
    Method method = entry.getKey();
    List<Class<? extends Throwable>> exceptionTypes = new ArrayList<>();
    exceptionTypes.addAll(Arrays.asList(entry.getValue().value()));
    if (exceptionTypes.isEmpty()) {
      exceptionTypes.addAll(getExceptionsFromMethodSignature(method));
    }
    for (Class<? extends Throwable> exceptionType : exceptionTypes) {
      Method oldMethod = result.put(exceptionType, method);
      if (oldMethod != null && !oldMethod.equals(method)) {
        throw new IllegalStateException("Ambiguous @ExceptionHandler method mapped for [" +
            exceptionType + "]: {" + oldMethod + ", " + method + "}");
      }
    }
  }
  return result;
}
origin: spring-projects/spring-framework

private void updateFilters() {
  if (this.filters.isEmpty()) {
    return;
  }
  List<WebFilter> filtersToUse = this.filters.stream()
      .peek(filter -> {
        if (filter instanceof ForwardedHeaderTransformer && this.forwardedHeaderTransformer == null) {
          this.forwardedHeaderTransformer = (ForwardedHeaderTransformer) filter;
        }
      })
      .filter(filter -> !(filter instanceof ForwardedHeaderTransformer))
      .collect(Collectors.toList());
  this.filters.clear();
  this.filters.addAll(filtersToUse);
}
origin: apache/flink

public static InputGate createInputGate(Collection<InputGate> inputGates1, Collection<InputGate> inputGates2) {
  List<InputGate> gates = new ArrayList<InputGate>(inputGates1.size() + inputGates2.size());
  gates.addAll(inputGates1);
  gates.addAll(inputGates2);
  return createInputGate(gates.toArray(new InputGate[gates.size()]));
}
origin: spring-projects/spring-framework

@Test
public void multipleKeyRows() {
  Map<String, Object> m = new HashMap<String, Object>() {{
    put("key", 1);
    put("seq", 2);
  }};
  kh.getKeyList().addAll(asList(m, m));
  assertEquals("two rows should be in the list", 2, kh.getKeyList().size());
  exception.expect(InvalidDataAccessApiUsageException.class);
  exception.expectMessage(startsWith("The getKeys method should only be used when keys for a single row are returned."));
  kh.getKeys();
}
origin: skylot/jadx

private static void insertAtStart(BlockNode block, List<InsnNode> insns) {
  List<InsnNode> blockInsns = block.getInstructions();
  List<InsnNode> newInsnList = new ArrayList<>(insns.size() + blockInsns.size());
  newInsnList.addAll(insns);
  newInsnList.addAll(blockInsns);
  blockInsns.clear();
  blockInsns.addAll(newInsnList);
}
origin: org.mockito/mockito-core

@Override
public Object[] getConstructorArgs() {
  if (outerClassInstance == null) {
    return constructorArgs;
  }
  List<Object> resultArgs = new ArrayList<Object>(constructorArgs.length + 1);
  resultArgs.add(outerClassInstance);
  resultArgs.addAll(Arrays.asList(constructorArgs));
  return resultArgs.toArray(new Object[constructorArgs.length + 1]);
}
origin: skylot/jadx

@Override
public List<IContainer> getBranches() {
  List<IContainer> branches = new ArrayList<>(cases.size() + 1);
  branches.addAll(cases);
  branches.add(defCase);
  return Collections.unmodifiableList(branches);
}
origin: spring-projects/spring-framework

private static List<MediaType> initMediaTypes(@Nullable HttpMessageWriter<?> formWriter) {
  List<MediaType> result = new ArrayList<>();
  result.add(MediaType.MULTIPART_FORM_DATA);
  if (formWriter != null) {
    result.addAll(formWriter.getWritableMediaTypes());
  }
  return Collections.unmodifiableList(result);
}
origin: alibaba/jstorm

public void declareStream(String streamId, boolean direct, Fields fields) {
  if (_fields.containsKey(streamId)) {
    throw new IllegalArgumentException("Fields for " + streamId + " already set");
  }
  List<String> fieldList = new ArrayList<>();
  fieldList.add(TransactionCommon.BATCH_GROUP_ID_FIELD);
  fieldList.addAll(fields.toList());
  _fields.put(streamId, new StreamInfo(fieldList, direct));
}
origin: prestodb/presto

@SafeVarargs
public static <T> TupleDomain<T> columnWiseUnion(TupleDomain<T> first, TupleDomain<T> second, TupleDomain<T>... rest)
{
  List<TupleDomain<T>> domains = new ArrayList<>(rest.length + 2);
  domains.add(first);
  domains.add(second);
  domains.addAll(Arrays.asList(rest));
  return columnWiseUnion(domains);
}
java.utilListaddAll

Javadoc

Inserts the objects in the specified collection at the specified location in this List. The objects are added in the order they are returned from the collection's iterator.

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.
  • 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
  • set
    Replaces the element at the specified position in this list with the specified element (optional ope
  • 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.
  • Top PhpStorm plugins
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