本文整理了Java中com.google.common.base.Predicate.test()
方法的一些代码示例,展示了Predicate.test()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Predicate.test()
方法的具体详情如下:
包路径:com.google.common.base.Predicate
类名称:Predicate
方法名:test
暂无
代码示例来源:origin: google/guava
@Override
public void forEach(Consumer<? super E> action) {
checkNotNull(action);
unfiltered.forEach(
(E e) -> {
if (predicate.test(e)) {
action.accept(e);
}
});
}
代码示例来源:origin: google/guava
@Override
public void forEach(Consumer<? super T> action) {
checkNotNull(action);
unfiltered.forEach(
(T a) -> {
if (retainIfTrue.test(a)) {
action.accept(a);
}
});
}
代码示例来源:origin: wildfly/wildfly
@Override
public void forEach(Consumer<? super T> action) {
checkNotNull(action);
unfiltered.forEach(
(T a) -> {
if (retainIfTrue.test(a)) {
action.accept(a);
}
});
}
代码示例来源:origin: wildfly/wildfly
@Override
public void forEach(Consumer<? super E> action) {
checkNotNull(action);
unfiltered.forEach(
(E e) -> {
if (predicate.test(e)) {
action.accept(e);
}
});
}
代码示例来源:origin: google/bundletool
/** Returns whether a given APK generated by the Bundle Tool should be installed on a device. */
private boolean matchesApk(
ApkTargeting apkTargeting,
boolean isSplit,
String moduleName,
Predicate<String> moduleNameMatcher) {
boolean matchesTargeting = matchesApkTargeting(apkTargeting);
if (isSplit) {
return matchesTargeting && moduleNameMatcher.test(moduleName);
} else {
if (matchesTargeting && requestedModuleNames.isPresent()) {
throw CommandExecutionException.builder()
.withMessage("Cannot restrict modules when the device matches a non-split APK.")
.build();
}
return matchesTargeting;
}
}
代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger
@Override
public void forEach(Consumer<? super T> action) {
checkNotNull(action);
unfiltered.forEach(
(T a) -> {
if (retainIfTrue.test(a)) {
action.accept(a);
}
});
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public void forEach(Consumer<? super E> action) {
checkNotNull(action);
unfiltered.forEach(
(E e) -> {
if (predicate.test(e)) {
action.accept(e);
}
});
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
@Override
public void forEach(Consumer<? super T> action) {
checkNotNull(action);
unfiltered.forEach(
(T a) -> {
if (retainIfTrue.test(a)) {
action.accept(a);
}
});
}
代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger
@Override
public void forEach(Consumer<? super E> action) {
checkNotNull(action);
unfiltered.forEach(
(E e) -> {
if (predicate.test(e)) {
action.accept(e);
}
});
}
代码示例来源:origin: com.google.javascript/closure-compiler
/**
* Returns whether anything in {@code universe} matches {@code predicate}.
*
* <p>This method is designed to minimize allocations since it is expected to be called
* <em>very</em> often. That's why is doesn't:
*
* <ul>
* <li>instantiate {@link Iterator}s
* <li>instantiate {@link Stream}s
* <li>(un)box primitives
* <li>expect closure generating lambdas
* </ul>
*/
private static boolean anyMatch(Predicate<JSType> predicate, ImmutableList<JSType> universe) {
for (int i = 0; i < universe.size(); i++) {
if (predicate.test(universe.get(i))) {
return true;
}
}
return false;
}
代码示例来源:origin: com.google.javascript/closure-compiler
/**
* Returns whether everything in {@code universe} matches {@code predicate}.
*
* <p>This method is designed to minimize allocations since it is expected to be called
* <em>very</em> often. That's why is doesn't:
*
* <ul>
* <li>instantiate {@link Iterator}s
* <li>instantiate {@link Stream}s
* <li>(un)box primitives
* <li>expect closure generating lambdas
* </ul>
*/
private static boolean allMatch(Predicate<JSType> predicate, ImmutableList<JSType> universe) {
for (int i = 0; i < universe.size(); i++) {
if (!predicate.test(universe.get(i))) {
return false;
}
}
return true;
}
}
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
@Override
public Flowable<Entry<K, V>> apply(Iterable<K> t) {
List<K> keys = Streams.stream(t)
.filter(key -> filter.test(key))
.collect(Collectors.toList());
return delegate.apply(keys);
}
}
代码示例来源:origin: bedatadriven/activityinfo
@Override
public void start(RefetchHandler handler) {
registration = eventBus.addHandler(FormChangeEvent.TYPE, event -> {
if (predicate.test(event.getChange())) {
// Our current result has become outdated, we need to fetch a new version from
// the server
handler.refetch();
}
});
}
代码示例来源:origin: TeamWizardry/Wizardry
List<Entity> list = world.getEntitiesWithinAABB(Entity.class, bb.grow(range, range, range), input -> {
if (predicateEntity == null) return true;
else return predicateEntity.test(input);
});
double closest = 0.0D;
代码示例来源:origin: TeamWizardry/Wizardry
if (targetBlock.canCollideCheck(targetState, false) && (predicateBlock == null || predicateBlock.test(targetBlock))) {
RayTraceResult raytraceresult1 = targetState.collisionRayTrace(world, targetPos, start, end);
内容来源于网络,如有侵权,请联系作者删除!