/** * Create a new Builder, hereby using the given * {@link ConversionContext}'s values as defaults. This allows changing * an existing {@link ConversionContext} easily. * * @param context the context, not {@code null} */ private ConversionContextBuilder(ConversionContext context) { importContext(context); }
/** * Create a new Builder, hereby using the given * {@link ConversionContext}'s values as defaults. This allows changing * an existing {@link ConversionContext} easily. * * @param context the provider context, not {@code null} * @param rateType the rate type, not null. */ private ConversionContextBuilder(ProviderContext context, RateType rateType) { importContext(context); setRateType(rateType); }
@Override public ExchangeRate getExchangeRate(ConversionQuery conversionQuery) { if (isAvailable(conversionQuery)) { return new TestExchangeRate.Builder( ConversionContextBuilder.create(getContext(), RateType.OTHER).importContext(conversionQuery) .build()).setFactor(new TestNumberValue(2)).setBase(conversionQuery.getBaseCurrency()) .setTerm(conversionQuery.getCurrency()).build(); } return null; }