[ 
https://issues.apache.org/jira/browse/LANG-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17925963#comment-17925963
 ] 

Elliotte Rusty Harold commented on LANG-1758:
---------------------------------------------

This doesn't feel common enough to me to justify adding the API.

> Enable use of compareTo to test for BigDecimal equality in 
> ReflectionDiffBuilder
> --------------------------------------------------------------------------------
>
>                 Key: LANG-1758
>                 URL: https://issues.apache.org/jira/browse/LANG-1758
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Krzysztof Sierszeń
>            Priority: Minor
>
> ATM all fields seem to be compared using equals in 
> `org.apache.commons.lang3.builder.ReflectionDiffBuilder`. 
> However, comparing BigDecimals using compareTo (i.e. ignoring precision) is 
> such a common use case, that I feel this could be a configuration option for 
> `ReflectionDiffBuilder`. 
> I can also think of two more generic alternatives:
> #  a config option like `.usingComparatorForType(Class<T>, Comparator<? super 
> T>)`
> # compare *all* `Comparable` types using `compareTo` rather than `equals` 
> (potentially also configurable via an option like 
> `.preferCompareToOverEquals(bool)`



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to