I have an overrriden method like this
@Override public Build auth (Map.Entry<String, String> auth) { this.mAuth = auth; return this; }
Here I am trying to call this method as follows
Map<String, String> authentication = new HashMap<String , String> (); authentication.put("username" , "testname"); authentication.put("password" , "testpassword"); Map.Entry<String, String> authInfo =(Entry<String , String>) authentication.entrySet(); AuthMethod.auth(authInfo)
When starting this process, I get
java.lang.ClassCastException: java.util.HashMap$EntrySet cannot be cast to java.util.Map$Entry
How can I pass Map.Entry<String, String> to the auth method
source share