Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package io.zipcoder.currencyconverterapplication;

public interface ConvertableCurrency {


default Double convert(CurrencyType currencyType) {
return Double.MAX_VALUE;
//make this hoe call the currencyConverter?
return currencyType.getRate()/CurrencyType.getTypeOfCurrency(this).getRate();
//return Double.MAX_VALUE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public Double getRate() {
}

public static CurrencyType getTypeOfCurrency(ConvertableCurrency currency) {
for(CurrencyType currencyType : CurrencyType.values()){
String currencyTypeName = currencyType.name().replace("_","");
String convertableCurrencyName = currency.getClass().getSimpleName();
if(currencyTypeName.equalsIgnoreCase(convertableCurrencyName)){
return currencyType;
}
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
import io.zipcoder.currencyconverterapplication.ConvertableCurrency;

public class AustralianDollar implements ConvertableCurrency {

}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.