Tabnine Logo
java.util.stream
Code IndexAdd Tabnine to your IDE (free)

How to use java.util.stream

Best Java code snippets using java.util.stream (Showing top 20 results out of 120,213)

origin: google/guava

/**
 * Returns an {@link IntStream} containing the elements of the first stream, followed by the
 * elements of the second stream, and so on.
 *
 * <p>This is equivalent to {@code Stream.of(streams).flatMapToInt(stream -> stream)}, but the
 * returned stream may perform better.
 *
 * @see IntStream#concat(IntStream, IntStream)
 */
public static IntStream concat(IntStream... streams) {
 // TODO(lowasser): optimize this later
 return Stream.of(streams).flatMapToInt(stream -> stream);
}
origin: google/guava

@Override
public Spliterator<T> spliterator() {
 return Stream.generate(() -> iterable).flatMap(Streams::stream).spliterator();
}
origin: google/guava

/**
 * Returns a {@link DoubleStream} containing the elements of the first stream, followed by the
 * elements of the second stream, and so on.
 *
 * <p>This is equivalent to {@code Stream.of(streams).flatMapToDouble(stream -> stream)}, but the
 * returned stream may perform better.
 *
 * @see DoubleStream#concat(DoubleStream, DoubleStream)
 */
public static DoubleStream concat(DoubleStream... streams) {
 // TODO(lowasser): optimize this later
 return Stream.of(streams).flatMapToDouble(stream -> stream);
}
origin: spring-projects/spring-framework

  private String formatFilters() {
    return this.filters.stream().map(Object::toString)
        .collect(joining(",\n\t\t", "[\n\t\t", "\n\t]"));
  }
}
origin: spring-projects/spring-framework

/**
 * Re-create the given mime types as media types.
 * @since 5.0
 */
public static List<MediaType> asMediaTypes(List<MimeType> mimeTypes) {
  return mimeTypes.stream().map(MediaType::asMediaType).collect(Collectors.toList());
}
origin: spring-projects/spring-framework

/**
 * Return all registered interceptors.
 */
protected List<Object> getInterceptors() {
  return this.registrations.stream()
      .sorted(INTERCEPTOR_ORDER_COMPARATOR)
      .map(InterceptorRegistration::getInterceptor)
      .collect(Collectors.toList());
}
origin: apache/incubator-dubbo

private <T> List<Invoker<T>> filterInvoker(List<Invoker<T>> invokers, Predicate<Invoker<T>> predicate) {
  return invokers.stream()
      .filter(predicate)
      .collect(Collectors.toList());
}
origin: spring-projects/spring-framework

/**
 * Convert the supplied paths to a list of {@link Resource} handles using
 * the given {@link ResourceLoader}.
 * @param resourceLoader the {@code ResourceLoader} to use to convert the paths
 * @param paths the paths to be converted
 * @return a new list of resources
 * @since 4.2
 * @see #convertToResources(ResourceLoader, String...)
 * @see #convertToClasspathResourcePaths
 */
public static List<Resource> convertToResourceList(ResourceLoader resourceLoader, String... paths) {
  return stream(resourceLoader, paths).collect(Collectors.toList());
}
origin: google/guava

/**
 * Returns a {@link LongStream} containing the elements of the first stream, followed by the
 * elements of the second stream, and so on.
 *
 * <p>This is equivalent to {@code Stream.of(streams).flatMapToLong(stream -> stream)}, but the
 * returned stream may perform better.
 *
 * @see LongStream#concat(LongStream, LongStream)
 */
public static LongStream concat(LongStream... streams) {
 // TODO(lowasser): optimize this later
 return Stream.of(streams).flatMapToLong(stream -> stream);
}
origin: spring-projects/spring-framework

private static Stream<Class<?>> testClasses() {
  // @formatter:off
  return Stream.of(
      AlwaysFailingBeforeTestClassTestCase.class,
      AlwaysFailingAfterTestClassTestCase.class,
      AlwaysFailingPrepareTestInstanceTestCase.class,
      AlwaysFailingBeforeTestMethodTestCase.class,
      AlwaysFailingBeforeTestExecutionTestCase.class,
      AlwaysFailingAfterTestExecutionTestCase.class,
      AlwaysFailingAfterTestMethodTestCase.class,
      FailingBeforeTransactionTestCase.class,
      FailingAfterTransactionTestCase.class);
  // @formatter:on
}
origin: google/guava

private static void doParallelCacheOp(int count, IntConsumer consumer) {
 IntStream.range(0, count).parallel().forEach(consumer);
}
origin: spring-projects/spring-framework

  private String formatFilters() {
    return this.filters.stream().map(Object::toString)
        .collect(joining(",\n\t\t", "[\n\t\t", "\n\t]"));
  }
}
origin: apache/incubator-dubbo

/**
 * get routed invokers from result of script rule evaluation
 */
@SuppressWarnings("unchecked")
protected <T> List<Invoker<T>> getRoutedInvokers(Object obj) {
  if (obj instanceof Invoker[]) {
    return Arrays.asList((Invoker<T>[]) obj);
  } else if (obj instanceof Object[]) {
    return Arrays.stream((Object[]) obj).map(item -> (Invoker<T>) item).collect(Collectors.toList());
  } else {
    return (List<Invoker<T>>) obj;
  }
}
origin: apache/incubator-dubbo

private <T> List<Invoker<T>> filterInvoker(List<Invoker<T>> invokers, Predicate<Invoker<T>> predicate) {
  return invokers.stream()
      .filter(predicate)
      .collect(Collectors.toList());
}
origin: google/guava

 public WithStreamParameter(Stream<?> s, String str) {
  this.list = s.collect(Collectors.toList());
  checkNotNull(str);
 }
}
origin: spring-projects/spring-framework

private String formatMethods(Set<Method> methods) {
  return "\nMatched:\n" + methods.stream()
      .map(Method::toGenericString).collect(joining(",\n\t", "[\n\t", "\n]"));
}
origin: spring-projects/spring-framework

public ItemMetadataMatcher(String type, Class<?>... stereotypes) {
  this(type, Arrays.stream(stereotypes)
      .map(Class::getName).collect(Collectors.toList()));
}
origin: spring-projects/spring-framework

  public List<TestBean> sortedTestBeans() {
    return this.testBeanProvider.orderedStream().collect(Collectors.toList());
  }
}
origin: spring-projects/spring-framework

private String formatMethods(Set<Method> methods) {
  return "\nMatched:\n" + methods.stream()
      .map(Method::toGenericString).collect(joining(",\n\t", "[\n\t", "\n]"));
}
origin: spring-projects/spring-framework

private static String partListDescription(List<? extends Part> parts) {
  return parts.stream().map(MultipartIntegrationTests::partDescription)
      .collect(Collectors.joining(",", "[", "]"));
}
java.util.stream

Most used classes

  • Stream
  • Collectors
  • IntStream
  • StreamSupport
  • LongStream
  • Collector,
  • Stream$Builder,
  • BaseStream,
  • DoubleStream$Builder,
  • IntStream$Builder,
  • LongStream$Builder,
  • Sink$OfDouble,
  • Sink$OfInt,
  • Sink$OfLong,
  • Sink,
  • Streams$RangeIntSpliterator
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