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