R
- the return type.public interface MonetaryQuery<R>
MonetaryQuery
. The first is
to invoke the method on this interface. The second is to use
MonetaryAmount.query(MonetaryQuery)
:
// these two lines are equivalent, but the second approach is recommended monetary = thisQuery.queryFrom(monetary); // Recommended approach monetary = monetary.query(thisQuery);It is recommended to use the second approach,
query(MonetaryQuery)
,
as it is a lot clearer to read in code.
Modifier and Type | Method and Description |
---|---|
R |
queryFrom(MonetaryAmount amount)
Queries the specified monetary amount.
|
R queryFrom(MonetaryAmount amount)
MonetaryQuery
. The first
is to invoke the method on this interface. The second is to use
MonetaryAmount.query(MonetaryQuery)
:
// these two lines are equivalent, but the second approach is recommended monetary = thisQuery.queryFrom(monetary); monetary = monetary.query(thisQuery);It is recommended to use the second approach,
query(MonetaryQuery)
, as it is a lot clearer to read in code.
MonetaryAmount
to determine the result. The input object must not be altered.
This method may be called from multiple threads in parallel. It must be
thread-safe when invoked.amount
- the monetary amount to query, not nullMonetaryException
- if unable to queryArithmeticException
- if numeric overflow occursCopyright © 2012–2015 JSR 354 - Expert Group. All rights reserved.