Skip to content

Commit

Permalink
Deprecate ConditionOutcome.inverse()
Browse files Browse the repository at this point in the history
1. It's not used anywhere.
2. The condition message is not applicable for reusing if match is reversed in practice.
3. The method is not doing much, we should call the constructor directly since it is public.
4. It's better to define it as instance method if it indeed required.

Signed-off-by: Yanming Zhou <[email protected]>
  • Loading branch information
quaff committed Jan 9, 2025
1 parent b48ce96 commit a421fd7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ public String toString() {
* Return the inverse of the specified condition outcome.
* @param outcome the outcome to inverse
* @return the inverse of the condition outcome
* @deprecated since 3.5.0 for removal in 3.6.0 in favor of
* {@link #ConditionOutcome(boolean, ConditionMessage)}
* @since 1.3.0
*/
@Deprecated(since = "3.5.0", forRemoval = true)
public static ConditionOutcome inverse(ConditionOutcome outcome) {
return new ConditionOutcome(!outcome.isMatch(), outcome.getConditionMessage());
}
Expand Down

0 comments on commit a421fd7

Please sign in to comment.