MCPcopy Index your code
hub / github.com/antlr/codebuff / InstanceOfPredicate

Class InstanceOfPredicate

output/java_guava/1.4.17/Predicates.java:534–567  ·  view source on GitHub ↗

@see Predicates#instanceOf(Class)

Source from the content-addressed store, hash-verified

532 /** @see Predicates#instanceOf(Class) */
533
534 @GwtIncompatible // Class.isInstance
535 private static class InstanceOfPredicate implements Predicate<Object>, Serializable {
536
537 private final Class<?> clazz;
538 private InstanceOfPredicate(Class<?> clazz) {
539 this.clazz = checkNotNull(clazz);
540 }
541
542 @Override
543 public boolean apply(@Nullable Object o) {
544 return clazz.isInstance(o);
545 }
546
547 @Override
548 public int hashCode() {
549 return clazz.hashCode();
550 }
551
552 @Override
553 public boolean equals(@Nullable Object obj) {
554 if (obj instanceof InstanceOfPredicate) {
555 InstanceOfPredicate that = (InstanceOfPredicate) obj;
556 return clazz == that.clazz;
557 }
558 return false;
559 }
560
561 @Override
562 public String toString() {
563 return "Predicates.instanceOf(" + clazz.getName() + ")";
564 }
565
566 private static final long serialVersionUID = 0;
567 }
568
569 /** @see Predicates#subtypeOf(Class) */
570

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected