Hello mates,
I am trying to get Links for an account and i am having the error below:
Object cannot be converted to Link
Code:
...
Object aplicacionesLink = IdentityDetails.getLinks();
String fecha0;
String fechaRol;
String startDate2 = new SimpleDateFormat("yyyyMMdd").format(new Date());
String NombreDetails;
if (aplicacionesLink instanceof List) {
List LinksIdentity = (List) aplicacionesLink;
for (Link linkIde : LinksIdentity) {
Application appnameComp = linkIde.getApplication();
if (appnameComp == appPortal) {
List atributoConfecha = linkIde.getAttribute("Role Details");
for (String RoleDet : atributoConfecha) {
try {
int startIndex = RoleDet.indexOf("#");
NombreDetails = RoleDet.substring(0, startIndex);
if (NombreDetails == roleName) {
fecha0 = RoleDet.substring(RoleDet.indexOf("#") + 1);
fechaRol = fecha0.substring(0, 10);
requestLineDataMap.put("ValidFrom", fechaRol);
}
else {
requestLineDataMap.put("ValidFrom", startDate2);
}
} catch (Exception e) {
System.out.println(e.getMessage());
requestLineDataMap.put("ValidFrom", startDate2);
}
}
}
}
}
Could anyone help me, please!?
Any tip or help will be welcome!
Thank you so much