Class ConfigurationExchangeRateInfoProvider
- java.lang.Object
-
- com.broadleafcommerce.pricing.provider.exchangerate.ConfigurationExchangeRateInfoProvider
-
- All Implemented Interfaces:
ExchangeRateInfoProvider
@ConfigurationProperties(prefix="broadleaf.pricing") public class ConfigurationExchangeRateInfoProvider extends Object implements ExchangeRateInfoProvider
This implementation is useful for testing and demo purposes. It obtains exchange rates from a property file.- Author:
- Brian Polster (bpolster)
-
-
Constructor Summary
Constructors Constructor Description ConfigurationExchangeRateInfoProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
ExchangeRateInfo
getExchangeRateInfo()
ExchangeRateInfo
getLatestExchangeRates(Optional<String> baseCurrency)
Implementation that reads the ExchangeRateInfo object from a properties file.int
hashCode()
void
setExchangeRateInfo(ExchangeRateInfo exchangeRateInfo)
String
toString()
-
-
-
Method Detail
-
getLatestExchangeRates
public ExchangeRateInfo getLatestExchangeRates(Optional<String> baseCurrency)
Implementation that reads the ExchangeRateInfo object from a properties file. This implementation IGNORES the passed in base currency and accepts null as parameter. The actual base currency returned in the exchangeRateInfo will be the one defined in the configuration YAML.- Specified by:
getLatestExchangeRates
in interfaceExchangeRateInfoProvider
- Parameters:
baseCurrency
-- Returns:
-
getExchangeRateInfo
public ExchangeRateInfo getExchangeRateInfo()
-
setExchangeRateInfo
public void setExchangeRateInfo(ExchangeRateInfo exchangeRateInfo)
-
canEqual
protected boolean canEqual(Object other)
-
-