8181 * href="https://en.wikipedia.org/wiki/Exchange_rate#Quotations">Wikipedia:
8282 * Exchange Rate (Quotations)</a>
8383 */
84- class DefaultExchangeRate implements ExchangeRate , Serializable , Comparable <ExchangeRate >{
84+ class DefaultExchangeRate implements ExchangeRate , Serializable , Comparable <ExchangeRate > {
8585
8686 /**
8787 * serialVersionUID.
@@ -115,7 +115,7 @@ class DefaultExchangeRate implements ExchangeRate, Serializable, Comparable<Exch
115115 *
116116 * @param builder The Builder, never {@code null}.
117117 */
118- DefaultExchangeRate (ExchangeRateBuilder builder ){
118+ DefaultExchangeRate (ExchangeRateBuilder builder ) {
119119 Objects .requireNonNull (builder .base , "base may not be null." );
120120 Objects .requireNonNull (builder .term , "term may not be null." );
121121 Objects .requireNonNull (builder .factor , "factor may not be null." );
@@ -134,13 +134,13 @@ class DefaultExchangeRate implements ExchangeRate, Serializable, Comparable<Exch
134134 *
135135 * @param chain the chain to set.
136136 */
137- private void setExchangeRateChain (List <ExchangeRate > chain ){
137+ private void setExchangeRateChain (List <ExchangeRate > chain ) {
138138 this .chain .clear ();
139- if (Objects .isNull (chain ) || chain .isEmpty ()){
139+ if (Objects .isNull (chain ) || chain .isEmpty ()) {
140140 this .chain .add (this );
141- }else {
142- for (ExchangeRate rate : chain ){
143- if (Objects .isNull (rate )){
141+ } else {
142+ for (ExchangeRate rate : chain ) {
143+ if (Objects .isNull (rate )) {
144144 throw new IllegalArgumentException ("Rate Chain element can not be null." );
145145 }
146146 }
@@ -153,7 +153,7 @@ private void setExchangeRateChain(List<ExchangeRate> chain){
153153 *
154154 * @return the conversion context, never null.
155155 */
156- public final ConversionContext getConversionContext (){
156+ public final ConversionContext getConversionContext () {
157157 return this .conversionContext ;
158158 }
159159
@@ -162,7 +162,7 @@ public final ConversionContext getConversionContext(){
162162 *
163163 * @return the base {@link javax.money.CurrencyUnit}.
164164 */
165- public final CurrencyUnit getBaseCurrency (){
165+ public final CurrencyUnit getBaseCurrency () {
166166 return this .base ;
167167 }
168168
@@ -171,7 +171,7 @@ public final CurrencyUnit getBaseCurrency(){
171171 *
172172 * @return the term {@link javax.money.CurrencyUnit}.
173173 */
174- public final CurrencyUnit getCurrency (){
174+ public final CurrencyUnit getCurrency () {
175175 return this .term ;
176176 }
177177
@@ -180,7 +180,7 @@ public final CurrencyUnit getCurrency(){
180180 *
181181 * @return the bid factor for this exchange rate, or {@code null}.
182182 */
183- public final NumberValue getFactor (){
183+ public final NumberValue getFactor () {
184184 return this .factor ;
185185 }
186186
@@ -191,7 +191,7 @@ public final NumberValue getFactor(){
191191 * several instances. For a direct exchange rate, this equals to
192192 * <code>new ExchangeRate[]{this}</code>.
193193 */
194- public final List <ExchangeRate > getExchangeRateChain (){
194+ public final List <ExchangeRate > getExchangeRateChain () {
195195 return this .chain ;
196196 }
197197
@@ -207,7 +207,7 @@ public final List<ExchangeRate> getExchangeRateChain(){
207207 *
208208 * @return true, if the exchange rate is derived.
209209 */
210- public final boolean isDerived (){
210+ public final boolean isDerived () {
211211 return this .chain .size () > 1 ;
212212 }
213213
@@ -217,13 +217,13 @@ public final boolean isDerived(){
217217 * @see java.lang.Comparable#compareTo(java.lang.Object)
218218 */
219219 @ Override
220- public int compareTo (ExchangeRate o ){
220+ public int compareTo (ExchangeRate o ) {
221221 Objects .requireNonNull (o );
222222 int compare = this .getBaseCurrency ().getCurrencyCode ().compareTo (o .getBaseCurrency ().getCurrencyCode ());
223- if (compare == 0 ){
223+ if (compare == 0 ) {
224224 compare = this .getCurrency ().getCurrencyCode ().compareTo (o .getCurrency ().getCurrencyCode ());
225225 }
226- if (compare == 0 ){
226+ if (compare == 0 ) {
227227 compare = this .getConversionContext ().getProvider ().compareTo (o .getConversionContext ().getProvider ());
228228 }
229229 return compare ;
@@ -235,7 +235,7 @@ public int compareTo(ExchangeRate o){
235235 * @see java.lang.Object#toString()
236236 */
237237 @ Override
238- public String toString (){
238+ public String toString () {
239239 return "ExchangeRate [base=" + base + ", factor=" + factor + ", conversionContext=" + conversionContext + ']' ;
240240 }
241241
@@ -245,7 +245,7 @@ public String toString(){
245245 * @see java.lang.Object#hashCode()
246246 */
247247 @ Override
248- public int hashCode (){
248+ public int hashCode () {
249249 return Objects .hash (base , conversionContext , factor , term , chain );
250250 }
251251
@@ -255,11 +255,11 @@ public int hashCode(){
255255 * @see java.lang.Object#equals(java.lang.Object)
256256 */
257257 @ Override
258- public boolean equals (Object obj ){
259- if (obj == this ){
258+ public boolean equals (Object obj ) {
259+ if (obj == this ) {
260260 return true ;
261261 }
262- if (obj instanceof DefaultExchangeRate ){
262+ if (obj instanceof DefaultExchangeRate ) {
263263 DefaultExchangeRate other = (DefaultExchangeRate ) obj ;
264264 return Objects .equals (base , other .base ) && Objects .equals (chain , other .chain ) &&
265265 Objects .equals (conversionContext , other .conversionContext ) &&
@@ -273,7 +273,7 @@ public boolean equals(Object obj){
273273 *
274274 * @return a new {@link ExchangeRateBuilder}, never {@code null}.
275275 */
276- public ExchangeRateBuilder toBuilder (){
276+ public ExchangeRateBuilder toBuilder () {
277277 return new ExchangeRateBuilder (getConversionContext ()).setBase (getBaseCurrency ()).setTerm (getCurrency ())
278278 .setFactor (getFactor ()).setRateChain (getExchangeRateChain ());
279279 }
0 commit comments