* Create pom.xml

* Update pom.xml

* Create pom.xml

* Update pom.xml

* add impl

* add app
This commit is contained in:
eelhazati
2018-03-04 10:44:05 +00:00
committed by pauljervis
parent 37223104c4
commit 09bb65a846
16 changed files with 357 additions and 0 deletions
@@ -0,0 +1,21 @@
package com.baeldung.rate.app;
import com.baeldung.rate.ExchangeRate;
import com.baeldung.rate.api.Quote;
import java.time.LocalDate;
import java.util.List;
public class MainApp {
public static void main(String... args) {
ExchangeRate.providers().forEach(provider -> {
System.out.println("Retreiving USD quotes from provider :" + provider);
List<Quote> quotes = provider.create().getQuotes("USD", LocalDate.now());
System.out.println(String.format("%14s%12s|%12s", "","Ask", "Bid"));
System.out.println("----------------------------------------");
quotes.forEach(quote -> {
System.out.println("USD --> " + quote.getCurrency() + " : " + String.format("%12f|%12f", quote.getAsk(), quote.getBid()));
});
});
}
}