1818 * @author Anatole Tresch
1919 * @author Werner Keil
2020 */
21- public class ExchangeRateBuilder {
21+ public class ExchangeRateBuilder {
2222
2323 /**
2424 * The {@link javax.money.convert.ConversionContext}.
@@ -46,7 +46,7 @@ public class ExchangeRateBuilder{
4646 *
4747 * @param rateType the {@link javax.money.convert.RateType} contained
4848 */
49- public ExchangeRateBuilder (String provider , RateType rateType ){
49+ public ExchangeRateBuilder (String provider , RateType rateType ) {
5050 this (ConversionContext .of (provider , rateType ));
5151 }
5252
@@ -55,7 +55,7 @@ public ExchangeRateBuilder(String provider, RateType rateType){
5555 *
5656 * @param context the {@link javax.money.convert.ConversionContext} to be applied
5757 */
58- public ExchangeRateBuilder (ConversionContext context ){
58+ public ExchangeRateBuilder (ConversionContext context ) {
5959 setContext (context );
6060 }
6161
@@ -64,7 +64,7 @@ public ExchangeRateBuilder(ConversionContext context){
6464 *
6565 * @param rate the {@link javax.money.convert.ExchangeRate} to be applied
6666 */
67- public ExchangeRateBuilder (ExchangeRate rate ){
67+ public ExchangeRateBuilder (ExchangeRate rate ) {
6868 setContext (rate .getConversionContext ());
6969 setFactor (rate .getFactor ());
7070 setTerm (rate .getCurrency ());
@@ -78,7 +78,7 @@ public ExchangeRateBuilder(ExchangeRate rate){
7878 * @param base to base (source) {@link javax.money.CurrencyUnit} to be applied
7979 * @return the builder instance
8080 */
81- public ExchangeRateBuilder setBase (CurrencyUnit base ){
81+ public ExchangeRateBuilder setBase (CurrencyUnit base ) {
8282 this .base = base ;
8383 return this ;
8484 }
@@ -89,7 +89,7 @@ public ExchangeRateBuilder setBase(CurrencyUnit base){
8989 * @param term to terminating {@link javax.money.CurrencyUnit} to be applied
9090 * @return the builder instance
9191 */
92- public ExchangeRateBuilder setTerm (CurrencyUnit term ){
92+ public ExchangeRateBuilder setTerm (CurrencyUnit term ) {
9393 this .term = term ;
9494 return this ;
9595 }
@@ -100,9 +100,9 @@ public ExchangeRateBuilder setTerm(CurrencyUnit term){
100100 * @param exchangeRates the {@link javax.money.convert.ExchangeRate} chain to be applied
101101 * @return the builder instance
102102 */
103- public ExchangeRateBuilder setRateChain (ExchangeRate ... exchangeRates ){
103+ public ExchangeRateBuilder setRateChain (ExchangeRate ... exchangeRates ) {
104104 this .rateChain .clear ();
105- if (Objects .nonNull (exchangeRates )){
105+ if (Objects .nonNull (exchangeRates )) {
106106 this .rateChain .addAll (Arrays .asList (exchangeRates .clone ()));
107107 }
108108 return this ;
@@ -114,9 +114,9 @@ public ExchangeRateBuilder setRateChain(ExchangeRate... exchangeRates){
114114 * @param exchangeRates the {@link javax.money.convert.ExchangeRate} chain to be applied
115115 * @return the builder instance
116116 */
117- public ExchangeRateBuilder setRateChain (List <ExchangeRate > exchangeRates ){
117+ public ExchangeRateBuilder setRateChain (List <ExchangeRate > exchangeRates ) {
118118 this .rateChain .clear ();
119- if (Objects .nonNull (exchangeRates )){
119+ if (Objects .nonNull (exchangeRates )) {
120120 this .rateChain .addAll (exchangeRates );
121121 }
122122 return this ;
@@ -130,7 +130,7 @@ public ExchangeRateBuilder setRateChain(List<ExchangeRate> exchangeRates){
130130 * @param factor the factor.
131131 * @return The builder instance.
132132 */
133- public ExchangeRateBuilder setFactor (NumberValue factor ){
133+ public ExchangeRateBuilder setFactor (NumberValue factor ) {
134134 this .factor = factor ;
135135 return this ;
136136 }
@@ -141,7 +141,7 @@ public ExchangeRateBuilder setFactor(NumberValue factor){
141141 * @param conversionContext the {@link javax.money.convert.ConversionContext}, not null.
142142 * @return The builder.
143143 */
144- public ExchangeRateBuilder setContext (ConversionContext conversionContext ){
144+ public ExchangeRateBuilder setContext (ConversionContext conversionContext ) {
145145 Objects .requireNonNull (conversionContext );
146146 this .conversionContext = conversionContext ;
147147 return this ;
@@ -153,7 +153,7 @@ public ExchangeRateBuilder setContext(ConversionContext conversionContext){
153153 * @return a new instance of {@link javax.money.convert.ExchangeRate}.
154154 * @throws IllegalArgumentException if the rate could not be built.
155155 */
156- public ExchangeRate build (){
156+ public ExchangeRate build () {
157157 return new DefaultExchangeRate (this );
158158 }
159159
@@ -165,7 +165,7 @@ public ExchangeRate build(){
165165 * @param rate the base rate
166166 * @return the Builder, for chaining.
167167 */
168- public ExchangeRateBuilder setRate (ExchangeRate rate ){
168+ public ExchangeRateBuilder setRate (ExchangeRate rate ) {
169169 this .base = rate .getBaseCurrency ();
170170 this .term = rate .getCurrency ();
171171 this .conversionContext = rate .getConversionContext ();
@@ -175,15 +175,15 @@ public ExchangeRateBuilder setRate(ExchangeRate rate){
175175 return this ;
176176 }
177177
178- @ Override
179- public String toString () {
180- StringBuilder sb = new StringBuilder ();
181- sb .append ("org.javamoney.moneta.ExchangeRateBuilder: " );
182- sb .append ("[conversionContext" ).append (conversionContext ).append (',' );
183- sb .append ("base" ).append (base ).append (',' );
184- sb .append ("term" ).append (term ).append (',' );
185- sb .append ("factor" ).append (factor ).append (',' );
186- sb .append ("rateChain" ).append (rateChain ).append (']' );
187- return sb .toString ();
188- }
178+ @ Override
179+ public String toString () {
180+ StringBuilder sb = new StringBuilder ();
181+ sb .append ("org.javamoney.moneta.ExchangeRateBuilder: " );
182+ sb .append ("[conversionContext" ).append (conversionContext ).append (',' );
183+ sb .append ("base" ).append (base ).append (',' );
184+ sb .append ("term" ).append (term ).append (',' );
185+ sb .append ("factor" ).append (factor ).append (',' );
186+ sb .append ("rateChain" ).append (rateChain ).append (']' );
187+ return sb .toString ();
188+ }
189189}
0 commit comments