Search in sources :

Example 1 with ContactNymDetails

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;
}
Also used : ContactNym(org.opentransactions.otapi.ContactNym) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) ContactNymDetails(com.moneychanger.core.dataobjects.ContactNymDetails)

Aggregations

ContactNymDetails (com.moneychanger.core.dataobjects.ContactNymDetails)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ContactNym (org.opentransactions.otapi.ContactNym)1