Contacts cont = new Contacts(); // you only create one of these
private static Contacts MapContacts(org.uddi.api_v2.Contacts contacts) { if (contacts == null) { return null; } Contacts c = new Contacts(); c.getContact().addAll(MapContactList(contacts.getContact())); return c; }
private static Contacts MapContacts(org.uddi.api_v3.Contacts contacts) { if (contacts == null) { return null; } Contacts c = new Contacts(); c.getContact().addAll(MapContactList(contacts.getContact())); return c; }
Contacts contacts = new Contacts(); contacts.setId(Integer.parseInt(cursor.getString(cursor.getColumnIndexOrThrow(KEY_ID)))); contacts.setName(cursor.getString(cursor.getColumnIndexOrThrow(KEY_NAME))); contacts.setMobile(cursor.getString(cursor.getColumnIndexOrThrow(KEY_MOBILE))); contacts.setHome(cursor.getString(cursor.getColumnIndexOrThrow(KEY_HOME))); contacts.setOffice(cursor.getString(cursor.getColumnIndexOrThrow(KEY_OFFICE))); contacts.setAddress(cursor.getString(cursor.getColumnIndexOrThrow(KEY_ADDRESS))); contacts.setEmail(cursor.getString(cursor.getColumnIndexOrThrow(KEY_EMAIL))); contacts.setCompanyName(cursor.getString(cursor.getColumnIndexOrThrow(KEY_COMPANYNAME))); contacts.setJobRole(cursor.getString(cursor.getColumnIndexOrThrow(KEY_JOBROLE)));
phone = cursorPhone .getString(cursorPhone .getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER)); Contacts contacts=new Contacts(); contacts.setContact_id(id); contacts.setContact_name(name); contacts.setMy_image(image_uri); contacts.setContact_number(phone.replaceAll("[\\s\\-()]", "")); contacts_list.add(contacts);
@Override protected String doInBackground(String... urls) { String result=""; for(int i = 0; i < msg_list.size(); i++){ Str_Msg = msg_list.get(i).getStrMsg().toString(); Str_Phone = msg_list.get(i).getStrNumber().toString(); Contacts person = new Contacts(); person.setPhone(Str_Phone); person.setName(Str_Msg); result= result + POST(urls[0], person); } return result; }
Users u = new Users(); u.setUser_id(2); //supposing i have a way to get the id of the user Contacts c = new Contacts(); c.setUser(u); c.setFirtname("young");// an so on for the rest of the properties contactdao.save(c);
Contacts contacts = new Contacts(); contacts.createContact();
Contacts cons = new Contacts(); cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted); cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #1");
public static void mapContacts(List<org.apache.juddi.model.Contact> modelContactList, org.uddi.api_v3.Contacts apiContacts, org.uddi.api_v3.BusinessEntity apiBusinessEntity) throws DispositionReportFaultMessage { if (modelContactList == null || modelContactList.size() == 0) { return; } if (apiContacts == null) { apiContacts = new org.uddi.api_v3.Contacts(); } List<org.uddi.api_v3.Contact> apiContactList = apiContacts.getContact(); apiContactList.clear(); for (org.apache.juddi.model.Contact modelContact : modelContactList) { org.uddi.api_v3.Contact apiContact = new org.uddi.api_v3.Contact(); mapContact(modelContact,apiContact); apiContactList.add(apiContact); } apiBusinessEntity.setContacts(apiContacts); }
public static void PrintContacts(Contacts contacts) { if (contacts == null) { return; } for (int i = 0; i < contacts.getContact().size(); i++) { System.out.println("Contact " + i + " type:" + contacts.getContact().get(i).getUseType()); for (int k = 0; k < contacts.getContact().get(i).getPersonName().size(); k++) { System.out.println("Name: " + contacts.getContact().get(i).getPersonName().get(k).getValue()); } for (int k = 0; k < contacts.getContact().get(i).getEmail().size(); k++) { System.out.println("Email: " + contacts.getContact().get(i).getEmail().get(k).getValue()); } for (int k = 0; k < contacts.getContact().get(i).getAddress().size(); k++) { System.out.println("Address sort code " + contacts.getContact().get(i).getAddress().get(k).getSortCode()); System.out.println("Address use type " + contacts.getContact().get(i).getAddress().get(k).getUseType()); System.out.println("Address tmodel key " + contacts.getContact().get(i).getAddress().get(k).getTModelKey()); for (int x = 0; x < contacts.getContact().get(i).getAddress().get(k).getAddressLine().size(); x++) { System.out.println("Address line value " + contacts.getContact().get(i).getAddress().get(k).getAddressLine().get(x).getValue()); System.out.println("Address line key name " + contacts.getContact().get(i).getAddress().get(k).getAddressLine().get(x).getKeyName()); System.out.println("Address line key value " + contacts.getContact().get(i).getAddress().get(k).getAddressLine().get(x).getKeyValue()); } } for (int k = 0; k < contacts.getContact().get(i).getDescription().size(); k++) { System.out.println("Desc: " + contacts.getContact().get(i).getDescription().get(k).getValue()); } for (int k = 0; k < contacts.getContact().get(i).getPhone().size(); k++) { System.out.println("Phone: " + contacts.getContact().get(i).getPhone().get(k).getValue()); } } }
public static void mapContacts(List<org.apache.juddi.model.Contact> modelContactList, org.uddi.api_v3.Contacts apiContacts, org.uddi.api_v3.BusinessEntity apiBusinessEntity) throws DispositionReportFaultMessage { if (modelContactList == null || modelContactList.size() == 0) { return; } if (apiContacts == null) { apiContacts = new org.uddi.api_v3.Contacts(); } List<org.uddi.api_v3.Contact> apiContactList = apiContacts.getContact(); apiContactList.clear(); for (org.apache.juddi.model.Contact modelContact : modelContactList) { org.uddi.api_v3.Contact apiContact = new org.uddi.api_v3.Contact(); mapContact(modelContact,apiContact); apiContactList.add(apiContact); } apiBusinessEntity.setContacts(apiContacts); }
public static void checkContacts(Contacts contacts1, Contacts contacts2) { if (contacts1 == null || contacts2 == null) { assertEquals(contacts1, contacts2); return; } List<Contact> contactList1 = contacts1.getContact(); List<Contact> contactList2 = contacts2.getContact(); if (contactList1 == null || contactList2 == null) { assertEquals(contactList1, contactList2); return; } assertEquals(contactList1.size(), contactList2.size()); Iterator<Contact> contactList1Itr = contactList1.iterator(); Iterator<Contact> contactList2Itr = contactList2.iterator(); while (contactList1Itr.hasNext()) { Contact contact1 = contactList1Itr.next(); Contact contact2 = contactList2Itr.next(); assertEquals(contact1.getUseType(), contact2.getUseType()); checkPersonNames(contact1.getPersonName(), contact2.getPersonName()); checkDescriptions(contact1.getDescription(), contact2.getDescription()); } }
while (rs.next()){ Contacts cont = new Contacts(); // move to within the loop so one is created for every row in the result set