Class NoOpCurrencyConversionService
- java.lang.Object
-
- com.broadleafcommerce.pricing.service.NoOpCurrencyConversionService
-
- All Implemented Interfaces:
CurrencyConversionService
public class NoOpCurrencyConversionService extends Object implements CurrencyConversionService
Implementation ofCurrencyConversionService
that does nothing it always returns false forcanCovert(CurrencyUnit, CurrencyUnit)
and errors if convert is called.- Author:
- Brian Polster (bpolster)
- See Also:
for an implementation
,for a sample API based implementation
-
-
Constructor Summary
Constructors Constructor Description NoOpCurrencyConversionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canCovert(javax.money.CurrencyUnit from, javax.money.CurrencyUnit to)
Always returns falseprotected boolean
canEqual(Object other)
javax.money.MonetaryAmount
convert(javax.money.MonetaryAmount fromAmount, javax.money.CurrencyUnit toCurrency)
Always throwsUnsupportedOperationException
.boolean
equals(Object o)
int
hashCode()
String
toString()
-
-
-
Method Detail
-
canCovert
public boolean canCovert(javax.money.CurrencyUnit from, javax.money.CurrencyUnit to)
Always returns false- Specified by:
canCovert
in interfaceCurrencyConversionService
- Parameters:
from
- The currency to convert from.to
- The currency to convert to.- Returns:
-
convert
public javax.money.MonetaryAmount convert(javax.money.MonetaryAmount fromAmount, javax.money.CurrencyUnit toCurrency)
Always throwsUnsupportedOperationException
. Callers should call canConvert prior to calling the convert operation which in the case of this provider will always return false.- Specified by:
convert
in interfaceCurrencyConversionService
- Parameters:
fromAmount
-toCurrency
-- Returns:
-
canEqual
protected boolean canEqual(Object other)
-
-