MCPcopy Create free account
hub / github.com/antlr/codebuff / NotPredicate

Class NotPredicate

output/java_guava/1.4.17/Predicates.java:375–407  ·  view source on GitHub ↗

@see Predicates#not(Predicate)

Source from the content-addressed store, hash-verified

373 /** @see Predicates#not(Predicate) */
374
375 private static class NotPredicate<T> implements Predicate<T>, Serializable {
376 final Predicate<T> predicate;
377
378 NotPredicate(Predicate<T> predicate) {
379 this.predicate = checkNotNull(predicate);
380 }
381
382 @Override
383 public boolean apply(@Nullable T t) {
384 return !predicate.apply(t);
385 }
386
387 @Override
388 public int hashCode() {
389 return ~predicate.hashCode();
390 }
391
392 @Override
393 public boolean equals(@Nullable Object obj) {
394 if (obj instanceof NotPredicate) {
395 NotPredicate<?> that = (NotPredicate<?>) obj;
396 return predicate.equals(that.predicate);
397 }
398 return false;
399 }
400
401 @Override
402 public String toString() {
403 return "Predicates.not(" + predicate + ")";
404 }
405
406 private static final long serialVersionUID = 0;
407 }
408
409 private static final Joiner COMMA_JOINER = Joiner.on(',');
410

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected