// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.data.object.user; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.TreeSet; // Referenced classes of package com.olio.data.object.user: // OlioContact public class OlioContactBuilder { private TreeSet emailAddresses; private boolean isGroup; private String name; private TreeSet phoneNumbers; private String photoUri; private int priority; private OlioContactBuilder() { } public static OlioContactBuilder anOlioContact() { return new OlioContactBuilder(); } private TreeSet getEmailAddressesCreateIfNull() { if (emailAddresses == null) { emailAddresses = new TreeSet(); } return emailAddresses; } private TreeSet getPhoneNumbersCreateIfNull() { if (phoneNumbers == null) { phoneNumbers = new TreeSet(); } return phoneNumbers; } public OlioContactBuilder addEmailAddresses(Collection collection) { if (collection != null) { getEmailAddressesCreateIfNull().addAll(collection); } return this; } public transient OlioContactBuilder addEmailAddresses(String as[]) { if (as != null) { Collections.addAll(getEmailAddressesCreateIfNull(), as); } return this; } public OlioContactBuilder addPhoneNumbers(Collection collection) { if (collection != null) { getPhoneNumbersCreateIfNull().addAll(collection); } return this; } public transient OlioContactBuilder addPhoneNumbers(String as[]) { if (as != null) { Collections.addAll(getPhoneNumbersCreateIfNull(), as); } return this; } public OlioContact build() { OlioContact oliocontact = new OlioContact(); oliocontact.setName(name); oliocontact.setPhotoUri(photoUri); oliocontact.setEmailAddresses(new ArrayList(getEmailAddressesCreateIfNull())); oliocontact.setPhoneNumbers(new ArrayList(getPhoneNumbersCreateIfNull())); oliocontact.setPriority(priority); oliocontact.setIsGroup(isGroup); return oliocontact; } public OlioContactBuilder but() { return anOlioContact().setName(name).addEmailAddresses(emailAddresses).addPhoneNumbers(phoneNumbers).setPhotoUri(photoUri).setPriority(priority).setIsGroup(isGroup); } public Collection getEmailAddresses() { return emailAddresses; } public Collection getPhoneNumbers() { return phoneNumbers; } public OlioContactBuilder setIsGroup(boolean flag) { isGroup = flag; return this; } public OlioContactBuilder setName(String s) { name = s; return this; } public OlioContactBuilder setPhotoUri(String s) { photoUri = s; return this; } public OlioContactBuilder setPriority(int i) { priority = i; return this; } }