Skip to main content

Re: Add five methods in Quantity interface[Proposal]

  • From: Otávio Gonçalves de Santana < >
  • To:
  • Subject: Re: Add five methods in Quantity interface[Proposal]
  • Date: Fri, 31 Oct 2014 18:14:15 -0200

Yes, there is some thing like this in JSR 354 and JSR 310:

In JSR 354:
https://github.com/JavaMoney/jsr354-api/blob/master/src/main/java/javax/money/MonetaryAmount.java


On Fri, Oct 31, 2014 at 5:55 PM, Werner Keil 
< >
 wrote:

> Let's have a look at it after the actual place of any such method is
> clarified.
> Feel free to create a JIRA ticket at any time.
>
> Do they match JavaMoney (JSR 354/Moneta) equivalents btw.?
> It's good to have that in JIRA, we'll figure our, if this helps on an API
> level or otherwise for RI.
>
> Thanks,
> Werner
>
> On Fri, Oct 31, 2014 at 8:36 PM, Otávio Gonçalves de Santana <
>  >
>  wrote:
>
>> I would like to propose to add four new comparatives methods in Quantity
>> interface:
>>
>>
>>    -   boolean isGreaterThan(Quantity<T> quantity);
>>    -   boolean isGreaterThanOrEqualTo(Quantity<T> quantity);
>>    -   boolean isLessThan(Quantity<T> quantity);
>>    -   boolean isLessThanOrEqualTo(Quantity<T> quantity);
>>    -   boolean isEquivalentTo(Quantity<T> quantity);
>>
>> The implementation should convert to the same unit and than compare.
>> So:
>>
>> Quantity<Time> oneHour = ...
>> Quantity<Time> sixtyMinutes = ...
>>
>> Should return true, when: oneHour.isEquivalentTo(sixtyMinutes);
>> --
>> Otávio Gonçalves de Santana
>>
>> blog:     http://otaviosantana.blogspot.com.br/
>> twitter: http://twitter.com/otaviojava
>> site:     *http://about.me/otaviojava ;<http://about.me/otaviojava>*
>> 55 (11) 98255-3513
>>
>>
>


-- 
Otávio Gonçalves de Santana

blog:     http://otaviosantana.blogspot.com.br/
twitter: http://twitter.com/otaviojava
site:     *http://about.me/otaviojava ;<http://about.me/otaviojava>*
55 (11) 98255-3513


Add five methods in Quantity interface[Proposal]

Otávio Gonçalves de Santana 10/31/2014

Re: Add five methods in Quantity interface[Proposal]

Werner Keil 10/31/2014

Re: Add five methods in Quantity interface[Proposal]

Otávio Gonçalves de Santana 10/31/2014

Re: Add five methods in Quantity interface[Proposal]

Otávio Gonçalves de Santana 10/31/2014

Re: Add five methods in Quantity interface[Proposal]

Werner Keil 10/31/2014

Re: Add five methods in Quantity interface[Proposal]

Otávio Gonçalves de Santana 10/31/2014

Re: Add five methods in Quantity interface[Proposal]

Werner Keil 10/31/2014
 
 
Close
loading
Please Confirm
Close