You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Chikashi Toyoshima (Jira)" <ji...@apache.org> on 2021/07/18 02:53:00 UTC
[jira] [Updated] (LANG-1665) Modify Tuple equals to take BigDecimal
comparison
[ https://issues.apache.org/jira/browse/LANG-1665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chikashi Toyoshima updated LANG-1665:
-------------------------------------
Description:
I understand that this would be a bit controversial. Imhp as possibly ignorable suggestion, it'd be more helpful if the Tupple supports BgDecimal numeric equality rather than simply checking object.
In a particular case, you may want to check if a collection of pairs contain a certain pair which includes BigDecimal values. Then to check object equality is maybe just right or not. But in many cases, I assume that numeric comparison would be more demanded.
```
Set<Pair<String, BigDecimal>> someCollection = getPairs();
someCollection.contains(Pair.of("foo"), BigDecimal.valueOf(100));
```
I created the PR. Please take a look. I'm happy to whichever it is accepted or not receiving feedback.
[https://github.com/apache/commons-lang/pull/780]
was:
I understand that this would a bit controversial. Imhp as possibly ignorable suggestion, it'd be more helpful if the Tupple supports BgDecimal numeric equality rather than simply checking object.
In a particular case, you may want to check if a collection of pairs contain a certain pair which includes BigDecimal values. Then to check object equality is maybe just right or not. But in many cases, I assume that numeric comparison would be more demanded.
```
Set<Pair<String, BigDecimal>> someCollection = getPairs();
someCollection.contains(Pair.of("foo"), BigDecimal.valueOf(100));
```
I created the PR. Please take a look. I'm happy to whichever it is accepted or not receiving feedback.
https://github.com/apache/commons-lang/pull/780
> Modify Tuple equals to take BigDecimal comparison
> -------------------------------------------------
>
> Key: LANG-1665
> URL: https://issues.apache.org/jira/browse/LANG-1665
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.tuple.*
> Affects Versions: 3.12.0
> Reporter: Chikashi Toyoshima
> Priority: Trivial
> Fix For: 3.12.0
>
>
> I understand that this would be a bit controversial. Imhp as possibly ignorable suggestion, it'd be more helpful if the Tupple supports BgDecimal numeric equality rather than simply checking object.
>
> In a particular case, you may want to check if a collection of pairs contain a certain pair which includes BigDecimal values. Then to check object equality is maybe just right or not. But in many cases, I assume that numeric comparison would be more demanded.
>
> ```
> Set<Pair<String, BigDecimal>> someCollection = getPairs();
> someCollection.contains(Pair.of("foo"), BigDecimal.valueOf(100));
> ```
>
> I created the PR. Please take a look. I'm happy to whichever it is accepted or not receiving feedback.
> [https://github.com/apache/commons-lang/pull/780]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)