Class UnitConverter
- java.lang.Object
-
- com.caplin.motif.fx.ret.common.utility.UnitConverter
-
public class UnitConverter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TRADED_UNIT
-
Constructor Summary
Constructors Constructor Description UnitConverter(AdapterConfiguration adapterConfiguration)
UnitConverter(AdapterConfiguration adapterConfiguration, GoodForAmountUtility goodForAmountUtility)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
convertFromOZTAmount(java.lang.String currencyPair, java.lang.String amount, java.lang.String unit)
java.lang.String
convertToDisplayedAmount(java.lang.String requestId, java.lang.String assetClass, java.lang.String amount, java.lang.String currencyPair, java.lang.String unit)
Anything converted from a traded amount with this method will only be an approximation of what was actually tradedjava.lang.String
convertToDisplayedGFA(java.lang.String assetClass, java.lang.String gfa, java.lang.String currencyPair, java.lang.String unit)
java.lang.String
convertToOZTAmount(java.lang.String currencyPair, java.lang.String amount, java.lang.String unit)
java.lang.String
convertToTradableAmount(java.lang.String requestId, java.lang.String assetClass, java.lang.String amount, java.lang.String currencyPair, java.lang.String unit)
java.util.List<java.lang.String>
getAllPreciousMetalsCurrencyPairs()
-
-
-
Field Detail
-
TRADED_UNIT
public static final java.lang.String TRADED_UNIT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UnitConverter
public UnitConverter(AdapterConfiguration adapterConfiguration) throws DataSourceConfigurationException
- Throws:
DataSourceConfigurationException
-
UnitConverter
public UnitConverter(AdapterConfiguration adapterConfiguration, GoodForAmountUtility goodForAmountUtility) throws DataSourceConfigurationException
- Throws:
DataSourceConfigurationException
-
-
Method Detail
-
getAllPreciousMetalsCurrencyPairs
public java.util.List<java.lang.String> getAllPreciousMetalsCurrencyPairs()
-
convertToTradableAmount
public java.lang.String convertToTradableAmount(java.lang.String requestId, java.lang.String assetClass, java.lang.String amount, java.lang.String currencyPair, java.lang.String unit) throws ConversionException
- Throws:
ConversionException
-
convertToDisplayedAmount
public java.lang.String convertToDisplayedAmount(java.lang.String requestId, java.lang.String assetClass, java.lang.String amount, java.lang.String currencyPair, java.lang.String unit) throws ConversionException
Anything converted from a traded amount with this method will only be an approximation of what was actually traded- Throws:
ConversionException
-
convertToDisplayedGFA
public java.lang.String convertToDisplayedGFA(java.lang.String assetClass, java.lang.String gfa, java.lang.String currencyPair, java.lang.String unit) throws ConversionException
- Throws:
ConversionException
-
convertToOZTAmount
public java.lang.String convertToOZTAmount(java.lang.String currencyPair, java.lang.String amount, java.lang.String unit) throws ConversionException
- Throws:
ConversionException
-
convertFromOZTAmount
public java.lang.String convertFromOZTAmount(java.lang.String currencyPair, java.lang.String amount, java.lang.String unit) throws ConversionException
- Throws:
ConversionException
-
-