Skip to content

Commit

Permalink
[pinpoint-apm#11543] Improve debuggability
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Oct 4, 2024
1 parent d80f7c5 commit dc4cb95
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,40 @@ private Predicates() {
}

@SuppressWarnings("rawtypes")
private static final Predicate IS_TRUE = new Predicate() {
private static final Predicate IS_TRUE = new TruePredicate();

@SuppressWarnings("rawtypes")
private static final Predicate IS_FALSE = new FalsePredicate();

@SuppressWarnings("rawtypes")
private static class TruePredicate implements Predicate {
@Override
public boolean test(Object o) {
return true;
}

@Override
public String toString() {
return "Predicates.isTrue()";
return "TruePredicate";
}
};

@SuppressWarnings("rawtypes")
private static final Predicate IS_FALSE = new Predicate() {
private static class FalsePredicate implements Predicate {
@Override
public boolean test(Object o) {
return false;
}

@Override
public String toString() {
return "Predicates.isFalse()";
return "FalsePredicate";
}
};
}

@SuppressWarnings("unchecked")
public static <T> Predicate<T> isTrue() {
return (Predicate<T>) IS_TRUE;
return IS_TRUE;
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit dc4cb95

Please sign in to comment.