I don't know what I did wrong. Can someone help me?
package fr.codegym.task.task19.task1903;
/*
Adaptation de plusieurs interfaces
*/
import java.util.HashMap;
import java.util.Map;
public class Solution {
public static Map<String, String> countries = new HashMap<>();
static {
countries.put("US","United States");
countries.put("UA","Ukraine");
countries.put("FR","France");
}
public static void main(String[] args) {
}
public static class IncomeDataAdapter implements Contact,Customer{
private IncomeData data;
public IncomeDataAdapter(IncomeData incomeData) {
this.data = incomeData;
}
@Override
public String getCompanyName() {
return data.getCompany();
}
@Override
public String getCountryName() {
return countries.get(data.getCountryCode());
}
@Override
public String getName() {
return data.getContactFirstName()+","+data.getContactLastName();
}
@Override
public String getPhoneNumber() {
int phone= data.getPhoneNumber();
while (phone<1000000000){
phone*=10;
}
StringBuilder sPhone= new StringBuilder();
sPhone.append(phone);
sPhone.insert(0,"(");
sPhone.insert(4,")");
sPhone.insert(8,"-");
sPhone.insert(11,"-");
return "+"+ data.getCountryPhoneCode() +sPhone;
}
}
public static interface IncomeData {
String getCountryCode(); // Par exemple : US
String getCompany(); // Par exemple : CodeGym Ltd.
String getContactFirstName(); // Par exemple : John
String getContactLastName(); // Par exemple : Smith
int getCountryPhoneCode(); // Par exemple : 1
int getPhoneNumber(); // Par exemple : 991234567
}
public static interface Customer {
String getCompanyName(); // Par exemple : CodeGym Ltd.
String getCountryName(); // Par exemple : Etats-Unis
}
public static interface Contact {
String getName(); // Par exemple : Smith, John
String getPhoneNumber(); // Par exemple : +1(099)123-45-67
}
}