Tabnine Logo
Stream.toArray
Code IndexAdd Tabnine to your IDE (free)

How to use
toArray
method
in
java.util.stream.Stream

Best Java code snippets using java.util.stream.Stream.toArray (Showing top 20 results out of 14,643)

Refine searchRefine arrow

  • Stream.map
  • Arrays.stream
  • List.stream
  • Stream.filter
  • Stream.of
origin: apache/incubator-druid

private static AggregatorFactory[] convertToCombiningFactories(AggregatorFactory[] metricsSpec)
{
 return Arrays.stream(metricsSpec)
        .map(AggregatorFactory::getCombiningFactory)
        .toArray(AggregatorFactory[]::new);
}
origin: prestodb/presto

public Factory(List<Supplier<LookupSource>> partitions)
{
  this.lookupSources = partitions.stream()
      .map(Supplier::get)
      .toArray(LookupSource[]::new);
  visitedPositions = Arrays.stream(this.lookupSources)
      .map(LookupSource::getJoinPositionCount)
      .map(Math::toIntExact)
      .map(boolean[]::new)
      .toArray(boolean[][]::new);
}
origin: apache/incubator-druid

protected static String[] extractFactoryName(final List<AggregatorFactory> aggregatorFactories)
{
 return aggregatorFactories.stream().map(AggregatorFactory::getName).toArray(String[]::new);
}
origin: neo4j/neo4j

private static String[] getJarsFullPaths( String... jars )
{
  return Stream.of( jars )
      .map( LuceneExplicitIndexUpgrader::getJarPath ).toArray( String[]::new );
}
origin: neo4j/neo4j

public static ValueType[] typesOfGroup( ValueGroup valueGroup )
{
  return Arrays.stream( ValueType.values() )
      .filter( t -> t.valueGroup == valueGroup )
      .toArray( ValueType[]::new );
}
origin: neo4j/neo4j

@Override
public File[] listFiles( File directory, final FilenameFilter filter )
{
  try ( Stream<Path> listing = Files.list( path( directory ) ) )
  {
    return listing
        .filter( entry -> filter.accept( entry.getParent().toFile(), entry.getFileName().toString() ) )
        .map( Path::toFile )
        .toArray( File[]::new );
  }
  catch ( IOException e )
  {
    return null;
  }
}
origin: ethereum/ethereumj

@Autowired
public VM(SystemProperties config, VMHook hook) {
  this.config = config;
  this.vmTrace = config.vmTrace();
  this.dumpBlock = config.dumpBlock();
  this.hooks = Stream.of(deprecatedHook, hook)
      .filter(h -> !h.isEmpty())
      .toArray(VMHook[]::new);
  this.hasHooks = this.hooks.length > 0;
}
origin: robolectric/robolectric

public static Path[] listFiles(Path path, final Predicate<Path> filter) throws IOException {
 try (Stream<Path> list = Files.list(path)) {
  return list.filter(filter).toArray(Path[]::new);
 }
}
origin: SonarSource/sonarqube

public DbTesterMyBatisConfExtension(Class<?> firstMapperClass, Class<?>... otherMapperClasses) {
 this.mapperClasses = Stream.concat(
  Stream.of(firstMapperClass),
  Arrays.stream(otherMapperClasses))
  .sorted(Comparator.comparing(Class::getName))
  .toArray(Class<?>[]::new);
}
origin: prestodb/presto

public Type[] getRelationCoercion(Relation relation)
{
  return Optional.ofNullable(relationCoercions.get(NodeRef.of(relation)))
      .map(types -> types.stream().toArray(Type[]::new))
      .orElse(null);
}
origin: prestodb/presto

@Override
public DriverPropertyInfo[] getPropertyInfo(String url, Properties info)
    throws SQLException
{
  Properties properties = new PrestoDriverUri(url, info).getProperties();
  return ConnectionProperties.allProperties().stream()
      .map(property -> property.getDriverPropertyInfo(properties))
      .toArray(DriverPropertyInfo[]::new);
}
origin: prestodb/presto

@Override
public Page getNextPage()
{
  Page nextPage = delegate.getNextPage();
  if (nextPage == null) {
    return null;
  }
  Block[] blocks = Arrays.stream(delegateFieldIndex)
      .mapToObj(nextPage::getBlock)
      .toArray(Block[]::new);
  return new Page(nextPage.getPositionCount(), blocks);
}
origin: baomidou/mybatis-plus

public Resource[] resolveMapperLocations() {
  return Stream.of(Optional.ofNullable(this.mapperLocations).orElse(new String[0]))
    .flatMap(location -> Stream.of(getResources(location)))
    .toArray(Resource[]::new);
}
origin: SonarSource/sonarqube

private String[] inclusions(Function<String, String[]> configProvider, String propertyKey) {
 return Arrays.stream(configProvider.apply(propertyKey))
  .map(StringUtils::trim)
  .filter(s -> !"**/*".equals(s))
  .filter(s -> !"file:**/*".equals(s))
  .toArray(String[]::new);
}
origin: eclipse-vertx/vert.x

/**
 * Creates a classloader respecting the classpath option.
 *
 * @return the classloader.
 */
protected synchronized ClassLoader createClassloader() {
 URL[] urls = classpath.stream().map(path -> {
  File file = new File(path);
  try {
   return file.toURI().toURL();
  } catch (MalformedURLException e) {
   throw new IllegalStateException(e);
  }
 }).toArray(URL[]::new);
 return new URLClassLoader(urls, this.getClass().getClassLoader());
}
origin: apache/flink

  private static TypeSerializer<?>[] snapshotsToRestoreSerializers(TypeSerializerSnapshot<?>... snapshots) {
    return Arrays.stream(snapshots)
        .map(TypeSerializerSnapshot::restoreSerializer)
        .toArray(TypeSerializer[]::new);
  }
}
origin: org.assertj/assertj-core

public static String extractedDescriptionOf(Object... items) {
 String[] itemsDescription = Stream.of(items).map(Object::toString).toArray(String[]::new);
 return extractedDescriptionOf(itemsDescription);
}

origin: neo4j/neo4j

public static ValueType[] including( Predicate<ValueType> include )
{
  return Arrays.stream( ValueType.values() )
      .filter( include )
      .toArray( ValueType[]::new );
}
origin: neo4j/neo4j

private StoreType[] relevantRecordStores()
{
  return Stream.of( StoreType.values() )
      .filter( type -> type.isRecordStore() && type != StoreType.META_DATA ).toArray( StoreType[]::new );
}
origin: apache/incubator-dubbo

private static String[] getFilteredKeys(URL url) {
  Map<String, String> params = url.getParameters();
  if (CollectionUtils.isNotEmptyMap(params)) {
    return params.keySet().stream()
        .filter(k -> k.startsWith(HIDE_KEY_PREFIX))
        .toArray(String[]::new);
  } else {
    return new String[0];
  }
}
java.util.streamStreamtoArray

Javadoc

Returns an array containing the elements of this stream.

This is a terminal operation.

Popular methods of Stream

  • collect
  • map
  • filter
  • forEach
  • findFirst
  • of
  • anyMatch
  • flatMap
  • sorted
  • findAny
  • count
  • allMatch
  • count,
  • allMatch,
  • concat,
  • reduce,
  • mapToInt,
  • distinct,
  • empty,
  • noneMatch,
  • iterator

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • findViewById (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ 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