@Override public boolean isEmpty() { return !Iterables.any(unfiltered, predicate); }
@Override public boolean isEmpty() { return !Iterables.any(unfiltered.entrySet(), entryPredicate); }
@Override public boolean isEmpty() { return !Iterables.any(unfiltered.entrySet(), entryPredicate); }
@Override public boolean isEmpty() { return !Iterables.any(unfiltered, predicate); }
/** * Returns {@code true} if any element in this fluent iterable satisfies the predicate. * * <p><b>{@code Stream} equivalent:</b> {@link Stream#anyMatch} (same). */ public final boolean anyMatch(Predicate<? super E> predicate) { return Iterables.any(getDelegate(), predicate); }
public boolean apply(@Nullable Member input) { return input != null && Iterables.any(annotationTypes(parameterAnnotations(input)), new Predicate<Class<? extends Annotation>>() { public boolean apply(@Nullable Class<? extends Annotation> input) { return input.equals(annotationClass); } }); } };
public boolean apply(@Nullable Member input) { return input != null && Iterables.any(parameterAnnotations(input), new Predicate<Annotation>() { public boolean apply(@Nullable Annotation input) { return areAnnotationMembersMatching(annotation, input); } }); } };
public boolean apply(@Nullable Member input) { return input != null && Iterables.any(parameterAnnotations(input), new Predicate<Annotation>() { public boolean apply(@Nullable Annotation input) { return areAnnotationMembersMatching(annotation, input); } }); } };
/** * Returns {@code true} if any element in this fluent iterable satisfies the predicate. * * <p><b>{@code Stream} equivalent:</b> {@link Stream#anyMatch} (same). */ public final boolean anyMatch(Predicate<? super E> predicate) { return Iterables.any(getDelegate(), predicate); }
boolean hasAnyNegativeInfinity() { return Iterables.any(values, Predicates.equalTo(NEGATIVE_INFINITY)); }
boolean hasAnyNaN() { return Iterables.any(values, Predicates.equalTo(NaN)); }
boolean hasAnyPositiveInfinity() { return Iterables.any(values, Predicates.equalTo(POSITIVE_INFINITY)); }
/** * Returns {@code true} if any element in this fluent iterable satisfies the predicate. * * <p><b>{@code Stream} equivalent:</b> {@link Stream#anyMatch} (same). */ public final boolean anyMatch(Predicate<? super E> predicate) { return Iterables.any(getDelegate(), predicate); }
public boolean isAggregationFunction(QualifiedName name) { return Iterables.any(functions.get(name), function -> function.getSignature().getKind() == AGGREGATE); }
@Override @Nullable public Choice<Unifier> visitNewArray(NewArrayTree newArray, @Nullable Unifier unifier) { boolean hasRepeated = getInitializers() != null && Iterables.any(getInitializers(), Predicates.instanceOf(URepeated.class)); return unifyNullable(unifier, getType(), newArray.getType()) .thenChoose(unifications(getDimensions(), newArray.getDimensions())) .thenChoose(unifications(getInitializers(), newArray.getInitializers(), hasRepeated)); }
@GwtIncompatible public void testImmediateCancelledFutureStack() throws Exception { ListenableFuture<String> future = CallerClass1.makeImmediateCancelledFuture(); assertTrue(future.isCancelled()); try { CallerClass2.get(future); fail(); } catch (CancellationException expected) { // There should be two CancellationException chained together. The outer one should have the // stack trace of where the get() call was made, and the inner should have the stack trace of // where the immediateCancelledFuture() call was made. List<StackTraceElement> stackTrace = ImmutableList.copyOf(expected.getStackTrace()); assertFalse(Iterables.any(stackTrace, hasClassName(CallerClass1.class))); assertTrue(Iterables.any(stackTrace, hasClassName(CallerClass2.class))); // See AbstractFutureCancellationCauseTest for how to set causes. assertThat(expected.getCause()).isNull(); } }
static boolean isSegmentLoaded(Iterable<ImmutableSegmentLoadInfo> serverView, SegmentDescriptor descriptor) { for (ImmutableSegmentLoadInfo segmentLoadInfo : serverView) { if (segmentLoadInfo.getSegment().getInterval().contains(descriptor.getInterval()) && segmentLoadInfo.getSegment().getShardSpec().getPartitionNum() == descriptor.getPartitionNumber() && segmentLoadInfo.getSegment().getVersion().compareTo(descriptor.getVersion()) >= 0 && Iterables.any( segmentLoadInfo.getServers(), DruidServerMetadata::segmentReplicatable )) { return true; } } return false; } }