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

Class SubtypeOfPredicate

output/java_guava/1.4.17/Predicates.java:571–604  ·  view source on GitHub ↗

@see Predicates#subtypeOf(Class)

Source from the content-addressed store, hash-verified

569 /** @see Predicates#subtypeOf(Class) */
570
571 @GwtIncompatible // Class.isAssignableFrom
572 private static class SubtypeOfPredicate implements Predicate<Class<?>>, Serializable {
573
574 private final Class<?> clazz;
575 private SubtypeOfPredicate(Class<?> clazz) {
576 this.clazz = checkNotNull(clazz);
577 }
578
579 @Override
580 public boolean apply(Class<?> input) {
581 return clazz.isAssignableFrom(input);
582 }
583
584 @Override
585 public int hashCode() {
586 return clazz.hashCode();
587 }
588
589 @Override
590 public boolean equals(@Nullable Object obj) {
591 if (obj instanceof SubtypeOfPredicate) {
592 SubtypeOfPredicate that = (SubtypeOfPredicate) obj;
593 return clazz == that.clazz;
594 }
595 return false;
596 }
597
598 @Override
599 public String toString() {
600 return "Predicates.subtypeOf(" + clazz.getName() + ")";
601 }
602
603 private static final long serialVersionUID = 0;
604 }
605
606 /** @see Predicates#in(Collection) */
607

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected