public final class ReportingCurrency extends Object implements org.joda.beans.ImmutableBean, Serializable
This is used to specify the currency that the result should be reporting in.
The currency specified may be explicit, using of(Currency), or implicit
using NATURAL. The "natural" currency of a target is obtained from
CalculationFunction.naturalCurrency(CalculationTarget, ReferenceData).
If the result is not associated with a currency, such as for "par rate", then the reporting currency will effectively be ignored.
| Modifier and Type | Class and Description |
|---|---|
static class |
ReportingCurrency.Meta
The meta-bean for
ReportingCurrency. |
| Modifier and Type | Field and Description |
|---|---|
static ReportingCurrency |
NATURAL
An instance requesting the "natural" currency of the target.
|
static ReportingCurrency |
NONE
An instance requesting no currency conversion.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Currency |
getCurrency()
Gets the currency if the type is 'Specific'.
|
ReportingCurrencyType |
getType()
Gets the type of reporting currency.
|
int |
hashCode() |
boolean |
isNatural()
Checks if the type is 'Natural'.
|
boolean |
isNone()
Checks if the type is 'None'.
|
boolean |
isSpecific()
Checks if the type is 'Specific'.
|
static ReportingCurrency.Meta |
meta()
The meta-bean for
ReportingCurrency. |
ReportingCurrency.Meta |
metaBean() |
static ReportingCurrency |
of(Currency currency)
Obtains an instance requesting the specified currency.
|
String |
toString() |
public static final ReportingCurrency NATURAL
When converting calculation results, conversion will occur to the "natural" currency of the target.
The "natural" currency of a target is obtained
from CalculationFunction.naturalCurrency(CalculationTarget, ReferenceData).
public static final ReportingCurrency NONE
Calculation results are normally converted to a single currency. If this reporting currency is used, then no currency conversion will be performed.
public static ReportingCurrency of(Currency currency)
When converting calculation results, conversion will occur to the specified currency.
This returns an instance with the type ReportingCurrencyType.SPECIFIC.
currency - the specific currencypublic boolean isSpecific()
When converting calculation results, conversion will occur to the specific currency
returned by getCurrency().
public boolean isNatural()
When converting calculation results, conversion will occur to the "natural" currency of the target.
The "natural" currency of a target is obtained
from CalculationFunction.naturalCurrency(CalculationTarget, ReferenceData).
public boolean isNone()
Calculation results are normally converted to a single currency. If this returns true than no currency conversion will be performed.
public Currency getCurrency()
If the type is 'Specific', this returns the currency. Otherwise, this throws an exception. As such, the type must be checked using #is
IllegalStateException - if called on a failure resultpublic static ReportingCurrency.Meta meta()
ReportingCurrency.public ReportingCurrency.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ReportingCurrencyType getType()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.