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

  • Finding current android device location
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Notification (javax.management)
  • Top 12 Jupyter Notebook extensions
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