use of com.moneychanger.core.dataobjects.ContactNymDetails in project otapij by FellowTraveler.
the class AddressBookHelper method getContactNymDetails.
public static ContactNymDetails getContactNymDetails(Contact contact, int index) {
ContactNymDetails data = new ContactNymDetails();
List serverList = new ArrayList();
if (contact != null && index > -1) {
ContactNym contactNYM = contact.GetContactNym(index);
if (contactNYM == null) {
System.out.println("getContactNymDetails contact.GetContactNym(index) returned null");
return null;
}
data.setLabel(contactNYM.getGui_label());
data.setMemo(contactNYM.getMemo());
data.setNymID(contactNYM.getNym_id());
data.setNymType(contactNYM.getNym_type());
data.setPublicKey(contactNYM.getPublic_key());
for (int i = 0; i < contactNYM.GetServerInfoCount(); i++) {
String[] servers = new String[2];
if (contactNYM.GetServerInfo(i) == null)
continue;
servers[0] = contactNYM.GetServerInfo(i).getServer_id();
servers[0] = contactNYM.GetServerInfo(i).getServer_type();
serverList.add(servers);
}
data.setServerList(serverList);
}
return data;
}
Aggregations