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

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

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

Refine searchRefine arrow

  • List.stream
  • Stream.map
  • Stream.collect
  • Collection.stream
  • Set.stream
origin: prestodb/presto

private static boolean allBlocksHaveRealAddress(List<InternalHiveBlock> blocks)
{
  return blocks.stream()
      .map(InternalHiveBlock::getAddresses)
      .allMatch(InternalHiveSplitFactory::hasRealAddress);
}
origin: apache/storm

/**
 * Convenience method for data.stream.allMatch(pred)
 */
public static <T> boolean isEvery(Collection<T> data, Predicate<T> pred) {
  return data.stream().allMatch(pred);
}
origin: prestodb/presto

private void printPlanNodesStatsAndCost(int indent, PlanNode... nodes)
{
  if (stream(nodes).allMatch(this::isPlanNodeStatsAndCostsUnknown)) {
    return;
  }
  print(indent, "Cost: %s", stream(nodes).map(this::formatPlanNodeStatsAndCost).collect(joining("/")));
}
origin: prestodb/presto

  @Override
  public Type createType(TypeManager typeManager, List<TypeParameter> parameters)
  {
    checkArgument(parameters.size() >= 1, "Function type must have at least one parameter, got %s", parameters);
    checkArgument(
        parameters.stream().allMatch(parameter -> parameter.getKind() == ParameterKind.TYPE),
        "Expected only types as a parameters, got %s",
        parameters);
    List<Type> types = parameters.stream().map(TypeParameter::getType).collect(toList());

    return new FunctionType(types.subList(0, types.size() - 1), types.get(types.size() - 1));
  }
}
origin: prestodb/presto

private static void verifyFileHasColumnNames(List<String> physicalColumnNames, Path path)
{
  if (!physicalColumnNames.isEmpty() && physicalColumnNames.stream().allMatch(physicalColumnName -> DEFAULT_HIVE_COLUMN_NAME_PATTERN.matcher(physicalColumnName).matches())) {
    throw new PrestoException(
        HIVE_FILE_MISSING_COLUMN_NAMES,
        "ORC file does not contain column names in the footer: " + path);
  }
}
origin: prestodb/presto

private static boolean allDistinctAggregates(AggregationNode aggregation)
{
  return aggregation.getAggregations()
      .values().stream()
      .map(Aggregation::getCall)
      .allMatch(FunctionCall::isDistinct);
}
origin: confluentinc/ksql

@Test
public void shouldBeThreadSafe() {
 // When:
 final List<CompletableFuture<Void>> futures = IntStream.range(1, 11).parallel()
   .mapToObj(idx -> {
    final CompletableFuture<Void> f = futureStore.getFutureForSequenceNumber(idx);
    if (idx % 10 == 0) {
     futureStore.completeFuturesUpToAndIncludingSequenceNumber(idx);
    }
    return f;
   })
   .collect(Collectors.toList());
 // Then:
 assertThat(futures.stream().allMatch(CompletableFuture::isDone), is(true));
}
origin: apache/storm

@Override
public boolean isReady(Set<String> nodeIds) {
  if (exceedsMaxTimeOut()) {
    Set<String> tmp = nodeIds.stream().filter(id -> !this.reportedIds.contains(id)).collect(toSet());
    LOG.warn("Failed to recover heartbeats for nodes: {} with timeout {}s", tmp, NODE_MAX_TIMEOUT_SECS);
    return true;
  }
  return nodeIds.stream().allMatch(id -> this.reportedIds.contains(id));
}
origin: MovingBlocks/Terasology

@SafeVarargs
@Override
public final Iterable<EntityRef> getEntitiesWith(Class<? extends Component>... componentClasses) {
  return () -> entityStore.keySet().stream()
      //Keep entities which have all of the required components
      .filter(id -> Arrays.stream(componentClasses)
          .allMatch(component -> componentStore.get(id, component) != null))
      .map(id -> getEntity(id))
      .iterator();
}
origin: wildfly/wildfly

public boolean hasAllResponses() {
  lock.lock();
  try {
    return responses.isEmpty() || responses.entrySet().stream().allMatch(entry -> entry.getValue() != null);
  }
  finally {
    lock.unlock();
  }
}
origin: prestodb/presto

private ComputedStatistics(
    List<String> groupingColumns,
    List<Block> groupingValues,
    Map<TableStatisticType, Block> tableStatistics,
    Map<ColumnStatisticMetadata, Block> columnStatistics)
{
  this.groupingColumns = unmodifiableList(new ArrayList<>(requireNonNull(groupingColumns, "groupingColumns is null")));
  this.groupingValues = unmodifiableList(new ArrayList<>(requireNonNull(groupingValues, "groupingValues is null")));
  if (!groupingValues.stream().allMatch(ComputedStatistics::isSingleValueBlock)) {
    throw new IllegalArgumentException("grouping value blocks are expected to be single value blocks");
  }
  this.tableStatistics = unmodifiableMap(new HashMap<>(requireNonNull(tableStatistics, "tableStatistics is null")));
  if (!tableStatistics.values().stream().allMatch(ComputedStatistics::isSingleValueBlock)) {
    throw new IllegalArgumentException("computed table statistics blocks are expected to be single value blocks");
  }
  this.columnStatistics = unmodifiableMap(new HashMap<>(requireNonNull(columnStatistics, "columnStatistics is null")));
  if (!columnStatistics.values().stream().allMatch(ComputedStatistics::isSingleValueBlock)) {
    throw new IllegalArgumentException("computed column statistics blocks are expected to be single value blocks");
  }
}
origin: google/error-prone

private static Predicate<String> areAllReturnStatementsAssignable(
  ImmutableSet<ClassType> returnStatementsTypes) {
 return s ->
   returnStatementsTypes.stream()
     .map(MutableMethodReturnType::getImmutableSuperTypesForClassType)
     .allMatch(c -> c.contains(s));
}
origin: prestodb/presto

private static List<ColumnStatistics> toFileStats(List<List<ColumnStatistics>> stripes)
{
  if (stripes.isEmpty()) {
    return ImmutableList.of();
  }
  int columnCount = stripes.get(0).size();
  checkArgument(stripes.stream().allMatch(stripe -> columnCount == stripe.size()));
  ImmutableList.Builder<ColumnStatistics> fileStats = ImmutableList.builder();
  for (int i = 0; i < columnCount; i++) {
    int column = i;
    fileStats.add(ColumnStatistics.mergeColumnStatistics(stripes.stream()
        .map(stripe -> stripe.get(column))
        .collect(toList())));
  }
  return fileStats.build();
}
origin: prestodb/presto

private static boolean isTypeWithLiteralParameters(TypeSignature typeSignature)
{
  return typeSignature.getParameters().stream()
      .map(TypeSignatureParameter::getKind)
      .allMatch(kind -> kind == ParameterKind.LONG || kind == ParameterKind.VARIABLE);
}
origin: prestodb/presto

@JsonProperty
public boolean isFinalQueryInfo()
{
  return state.isDone() && getAllStages(outputStage).stream().allMatch(StageInfo::isFinalStageInfo);
}
origin: joel-costigliola/assertj-core

@SafeVarargs
private final SELF satisfiesAnyOfAssertionsGroups(Consumer<ACTUAL>... assertionsGroups) throws AssertionError {
 checkArgument(stream(assertionsGroups).allMatch(assertions -> assertions != null), "No assertions group should be null");
 if (stream(assertionsGroups).anyMatch(this::satisfiesAssertions)) return myself;
 // none of the assertions group was met! let's report all the errors
 List<AssertionError> assertionErrors = stream(assertionsGroups).map(this::catchAssertionError).collect(toList());
 throw multipleAssertionsError(assertionErrors);
}
origin: prestodb/presto

public boolean isDecomposable(FunctionRegistry functionRegistry)
{
  boolean hasOrderBy = getAggregations().values().stream()
      .map(Aggregation::getCall)
      .map(FunctionCall::getOrderBy)
      .anyMatch(Optional::isPresent);
  boolean hasDistinct = getAggregations().values().stream()
      .map(Aggregation::getCall)
      .anyMatch(FunctionCall::isDistinct);
  boolean decomposableFunctions = getAggregations().values().stream()
      .map(Aggregation::getSignature)
      .map(functionRegistry::getAggregateFunctionImplementation)
      .allMatch(InternalAggregationFunction::isDecomposable);
  return !hasOrderBy && !hasDistinct && decomposableFunctions;
}
origin: neo4j/neo4j

public static boolean hasCompatibleCapabilities( RecordFormats one, RecordFormats other, CapabilityType type )
{
  Set<Capability> myFormatCapabilities = Stream.of( one.capabilities() )
      .filter( capability -> capability.isType( type ) ).collect( toSet() );
  Set<Capability> otherFormatCapabilities = Stream.of( other.capabilities() )
      .filter( capability -> capability.isType( type ) ).collect( toSet() );
  if ( myFormatCapabilities.equals( otherFormatCapabilities ) )
  {
    // If they have the same capabilities then of course they are compatible
    return true;
  }
  boolean capabilitiesNotRemoved = otherFormatCapabilities.containsAll( myFormatCapabilities );
  otherFormatCapabilities.removeAll( myFormatCapabilities );
  boolean allAddedAreAdditive = otherFormatCapabilities.stream().allMatch( Capability::isAdditive );
  // Even if capabilities of the two aren't the same then there's a special case where if the additional
  // capabilities of the other format are all additive then they are also compatible because no data
  // in the existing store needs to be migrated.
  return capabilitiesNotRemoved && allAddedAreAdditive;
}
origin: Graylog2/graylog2-server

@Override
public boolean isConstant() {
  return map.values().stream().allMatch(Expression::isConstant);
}
origin: apache/flink

private boolean checkForCustomFieldMapping(DescriptorProperties descriptorProperties, TableSchema schema) {
  final Map<String, String> fieldMapping = SchemaValidator.deriveFieldMapping(
    descriptorProperties,
    Optional.of(schema.toRowType())); // until FLINK-9870 is fixed we assume that the table schema is the output type
  return fieldMapping.size() != schema.getFieldNames().length ||
    !fieldMapping.entrySet().stream().allMatch(mapping -> mapping.getKey().equals(mapping.getValue()));
}
java.util.streamStreamallMatch

Javadoc

Returns whether all elements of this stream match the provided predicate. May not evaluate the predicate on all elements if not necessary for determining the result. If the stream is empty then true is returned and the predicate is not evaluated.

This is a short-circuiting terminal operation.

Popular methods of Stream

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

Popular in Java

  • Reading from database using SQL prepared statement
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • BoxLayout (javax.swing)
  • From CI to AI: The AI layer in your organization
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