@see Predicates#subtypeOf(Class)
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected