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

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

Best Java code snippets using java.util.stream.Stream.concat (Showing top 20 results out of 8,964)

Refine searchRefine arrow

  • Stream.collect
  • Stream.of
  • Stream.map
  • List.stream
  • Stream.filter
  • Collectors.toList
  • Set.stream
origin: google/guava

@Override
public Stream<E> stream() {
 return Stream.concat(set1.stream(), set2.stream().filter(e -> !set1.contains(e)));
}
origin: apache/kafka

public static <T> List<T> concatLists(List<T> left, List<T> right, Function<List<T>, List<T>> finisher) {
  return Stream.concat(left.stream(), right.stream())
      .collect(Collectors.collectingAndThen(Collectors.toList(), finisher));
}
origin: prestodb/presto

private static <T> Set<T> union(Set<T> set1, Set<T> set2)
{
  return Stream.concat(set1.stream(), set2.stream())
      .collect(toSet());
}
origin: spring-projects/spring-data-redis

@SuppressWarnings("Convert2MethodRef")
protected ByteBuffer[] keysAndArgs(RedisElementWriter argsWriter, List<K> keys, List<?> args) {
  return Stream.concat(keys.stream().map(t -> keySerializer().getWriter().write(t)),
      args.stream().map(t -> argsWriter.write(t))).toArray(size -> new ByteBuffer[size]);
}
origin: SonarSource/sonarqube

private void printSensors(Collection<ModuleSensorWrapper> moduleSensors, Collection<ModuleSensorWrapper> globalSensors) {
 String sensors = Stream
  .concat(moduleSensors.stream(), globalSensors.stream())
  .map(Object::toString)
  .collect(Collectors.joining(" -> "));
 LOG.debug("Sensors : {}", sensors);
}
origin: Netflix/zuul

    .map(String::trim)
    .filter(blank.negate());
    .map(String::trim)
    .filter(blank.negate())
    .flatMap(packageName -> cp.getTopLevelClasses(packageName).stream())
    .map(ClassPath.ClassInfo::load)
    .filter(ZuulFilter.class::isAssignableFrom)
    .map(Class::getCanonicalName);
String[] filterClassNames = Stream.concat(classNameStream, packageStream).toArray(String[]::new);
if (filterClassNames.length != 0) {
  LOG.info("Using filter classnames: ");
origin: prestodb/presto

public Optional<Column> getColumn(String name)
{
  return Stream.concat(partitionColumns.stream(), dataColumns.stream())
      .filter(column -> column.getName().equals(name))
      .findFirst();
}
origin: SonarSource/sonarqube

private List<String> searchEditableProfiles(DbSession dbSession, OrganizationDto organization) {
 if (!userSession.isLoggedIn()) {
  return emptyList();
 }
 String login = userSession.getLogin();
 UserDto user = dbClient.userDao().selectActiveUserByLogin(dbSession, login);
 checkState(user != null, "User with login '%s' is not found'", login);
 return Stream.concat(
  dbClient.qProfileEditUsersDao().selectQProfileUuidsByOrganizationAndUser(dbSession, organization, user).stream(),
  dbClient.qProfileEditGroupsDao().selectQProfileUuidsByOrganizationAndGroups(dbSession, organization, userSession.getGroups()).stream())
  .collect(toList());
}
origin: SonarSource/sonarqube

 private static List<QProfileDto> merge(QProfileDto profile, Collection<QProfileDto> descendants) {
  return Stream.concat(Stream.of(profile), descendants.stream())
   .collect(MoreCollectors.toList(descendants.size() + 1));
 }
}
origin: SonarSource/sonarqube

private static HighlightBuilder.Field createHighlighterField() {
 HighlightBuilder.Field field = new HighlightBuilder.Field(FIELD_NAME);
 field.highlighterType("fvh");
 field.matchedFields(
  Stream.concat(
   Stream.of(FIELD_NAME),
   Arrays
    .stream(NAME_ANALYZERS)
    .map(a -> a.subField(FIELD_NAME)))
   .toArray(String[]::new));
 return field;
}
origin: SonarSource/sonarqube

 private static <RAW extends Trackable, BASE extends Trackable> List<BASE> concatIssues(
  NonClosedTracking<RAW, BASE> nonClosedTracking, ClosedTracking<RAW, BASE> closedTracking) {
  Collection<BASE> nonClosedIssues = nonClosedTracking.getBaseInput().getIssues();
  Collection<BASE> closeIssues = closedTracking.getBaseInput().getIssues();
  return Stream.concat(nonClosedIssues.stream(), closeIssues.stream())
   .collect(toList(nonClosedIssues.size() + closeIssues.size()));
 }
}
origin: SonarSource/sonarqube

@Override
public void deleteIndexes(String name, String... otherNames) {
 GetMappingsResponse mappings = client.nativeClient().admin().indices().prepareGetMappings("_all").get();
 Set<String> existingIndices = Sets.newHashSet(mappings.mappings().keysIt());
 Stream.concat(Stream.of(name), Arrays.stream(otherNames))
  .distinct()
  .filter(existingIndices::contains)
  .forEach(this::deleteIndex);
}
origin: SonarSource/sonarqube

private String[] exclusions(Function<String, String[]> configProvider, String globalExclusionsProperty, String exclusionsProperty) {
 String[] globalExclusions = configProvider.apply(globalExclusionsProperty);
 String[] exclusions = configProvider.apply(exclusionsProperty);
 return Stream.concat(Arrays.stream(globalExclusions), Arrays.stream(exclusions))
  .map(StringUtils::trim)
  .toArray(String[]::new);
}
origin: SonarSource/sonarqube

@Test
public void checkNode_returns_YELLOW_status_if_only_GREEN_and_at_least_one_YELLOW_statuses_returned_by_NodeHealthCheck() {
 List<Health.Status> statuses = new ArrayList<>();
 Stream.concat(
  IntStream.range(0, 1 + random.nextInt(20)).mapToObj(i -> YELLOW), // at least 1 YELLOW
  IntStream.range(0, random.nextInt(20)).mapToObj(i -> GREEN)).forEach(statuses::add); // between 0 and 19 GREEN
 Collections.shuffle(statuses);
 HealthCheckerImpl underTest = newNodeHealthCheckerImpl(statuses.stream());
 assertThat(underTest.checkNode().getStatus())
  .describedAs("%s should have been computed from %s statuses", YELLOW, statuses)
  .isEqualTo(YELLOW);
}
origin: biezhi/30-seconds-of-java8

public static <T> T[] symmetricDifference(T[] first, T[] second) {
  Set<T> sA = new HashSet<>(Arrays.asList(first));
  Set<T> sB = new HashSet<>(Arrays.asList(second));
  return Stream.concat(
      Arrays.stream(first).filter(a -> !sB.contains(a)),
      Arrays.stream(second).filter(b -> !sA.contains(b))
  ).toArray(i -> (T[]) Arrays.copyOf(new Object[0], i, first.getClass()));
}
origin: SonarSource/sonarqube

public UriReader(SchemeProcessor[] processors) {
 Stream.concat(Stream.of(new FileProcessor()), Arrays.stream(processors)).forEach(processor -> {
  for (String scheme : processor.getSupportedSchemes()) {
   processorsByScheme.put(scheme.toLowerCase(Locale.ENGLISH), processor);
  }
 });
}
origin: prestodb/presto

@Override
public String toString()
{
  List<String> allConstraints = concat(
      typeVariableConstraints.stream().map(TypeVariableConstraint::toString),
      longVariableConstraints.stream().map(LongVariableConstraint::toString))
      .collect(Collectors.toList());
  return name + (allConstraints.isEmpty() ? "" : "<" + Joiner.on(",").join(allConstraints) + ">") + "(" + Joiner.on(",").join(argumentTypes) + "):" + returnType;
}
origin: prestodb/presto

private static <T> Set<T> union(Set<T> set1, Set<T> set2)
{
  return Stream.concat(set1.stream(), set2.stream())
      .collect(toSet());
}
origin: eclipse-vertx/vert.x

public static KeyStoreHelper create(VertxInternal vertx, TrustOptions options) throws Exception {
 if (options instanceof KeyCertOptions) {
  return create(vertx, (KeyCertOptions) options);
 } else if (options instanceof PemTrustOptions) {
  PemTrustOptions trustOptions = (PemTrustOptions) options;
  Stream<Buffer> certValues = trustOptions.
    getCertPaths().
    stream().
    map(path -> vertx.resolveFile(path).getAbsolutePath()).
    map(vertx.fileSystem()::readFileBlocking);
  certValues = Stream.concat(certValues, trustOptions.getCertValues().stream());
  return new KeyStoreHelper(loadCA(certValues), null);
 } else {
  return null;
 }
}
origin: Netflix/zuul

    .map(String::trim)
    .filter(blank.negate());
    .map(String::trim)
    .filter(blank.negate())
    .flatMap(packageName -> cp.getTopLevelClasses(packageName).stream())
    .map(ClassPath.ClassInfo::load)
    .filter(ZuulFilter.class::isAssignableFrom)
    .map(Class::getCanonicalName);
String[] filterClassNames = Stream.concat(classNameStream, packageStream).toArray(String[]::new);
if (filterClassNames.length != 0) {
  LOG.info("Using filter classnames: ");
java.util.streamStreamconcat

Popular methods of Stream

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

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Table (org.hibernate.mapping)
    A relational table
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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