// Path: app/src/main/java/com/sefford/material/sample/common/model/Contact.java
// public class Contact implements Comparable<Contact>, Renderable, RepoElement<Long>, Updateable<Contact> {
// 
//     long id;
//     Uri thumb;
//     Uri photo;
//     String name;
//     List<String> phones = new ArrayList<String>();
//     List<String> emails = new ArrayList<String>();
//     LayoutMode mode = LayoutMode.LIST;
// 
//     @Override
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(long id) {
//         this.id = id;
//         final Uri contactUri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id);
//         thumb = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
//         photo = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO);
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public List<String> getPhones() {
//         return phones;
//     }
// 
//     public void setPhones(List<String> phones) {
//         this.phones = phones;
//     }
// 
//     public void addPhone(String phone) {
//         this.phones.add(phone);
//     }
// 
//     public List<String> getEmails() {
//         return emails;
//     }
// 
//     public void setEmails(List<String> emails) {
//         this.emails = emails;
//     }
// 
//     public void addEmail(String email) {
//         this.emails.add(email);
//     }
// 
//     public Uri getThumbnail() {
//         return thumb;
//     }
// 
//     public Uri getPhoto() {
//         return photo;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         Contact contact = (Contact) o;
// 
//         if (id != contact.id) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         return (int) (id ^ (id >>> 32));
//     }
// 
//     @Override
//     public int compareTo(Contact another) {
//         return name.compareTo(another.name);
//     }
// 
//     @Override
//     public int getRenderableId() {
//         if (LayoutMode.LIST.equals(mode)) {
//             return R.layout.listitem_contact;
//         } else {
//             return R.layout.griditem_contact;
//         }
//     }
// 
//     @Override
//     public Contact update(Contact other) {
//         return this;
//     }
// 
//     public void setLayoutMode(LayoutMode layoutMode) {
//         this.mode = layoutMode;
//     }
// 
//     public enum LayoutMode {
//         LIST,
//         GRID,
//         STAGGER
//     }
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/contacts/details/ui/model/ContactData.java
// public class ContactData implements Renderable {
// 
//     final List<String> elements;
//     final int resource;
//     final int renderableId;
// 
//     public ContactData(List<String> elements, int resource, int renderableId) {
//         this.elements = elements;
//         this.resource = resource;
//         this.renderableId = renderableId;
//     }
// 
//     public List<String> getElements() {
//         return elements;
//     }
// 
//     public int getResource() {
//         return resource;
//     }
// 
// 
//     @Override
//     public int getRenderableId() {
//         return renderableId;
//     }
// }


import com.sefford.kor.responses.Response;
import com.sefford.material.sample.common.model.Contact;
import com.sefford.material.sample.contacts.details.ui.model.ContactData;
/*
 * Copyright (C) 2015 Saúl Díaz
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sefford.material.sample.contacts.details.responses;


/**
 * Contact Response with the information to populate the UI.
 */
public class GetContactResponse implements Response {

    final Contact contact;
    final ContactData phones;
    final ContactData mails;

    public GetContactResponse(Contact contact, ContactData phones, ContactData mails) {
        this.contact = contact;
        this.phones = phones;
        this.mails = mails;
    }

    @Override
    public boolean isSuccess() {
        return true;
    }

    @Override
    public boolean isFromNetwork() {
        return false;
    }

    public Contact getContact() {
        return contact;
    }

// Path: app/src/main/java/com/sefford/material/sample/common/model/Contact.java
// public class Contact implements Comparable<Contact>, Renderable, RepoElement<Long>, Updateable<Contact> {
// 
//     long id;
//     Uri thumb;
//     Uri photo;
//     String name;
//     List<String> phones = new ArrayList<String>();
//     List<String> emails = new ArrayList<String>();
//     LayoutMode mode = LayoutMode.LIST;
// 
//     @Override
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(long id) {
//         this.id = id;
//         final Uri contactUri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, id);
//         thumb = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);
//         photo = Uri.withAppendedPath(contactUri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO);
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public List<String> getPhones() {
//         return phones;
//     }
// 
//     public void setPhones(List<String> phones) {
//         this.phones = phones;
//     }
// 
//     public void addPhone(String phone) {
//         this.phones.add(phone);
//     }
// 
//     public List<String> getEmails() {
//         return emails;
//     }
// 
//     public void setEmails(List<String> emails) {
//         this.emails = emails;
//     }
// 
//     public void addEmail(String email) {
//         this.emails.add(email);
//     }
// 
//     public Uri getThumbnail() {
//         return thumb;
//     }
// 
//     public Uri getPhoto() {
//         return photo;
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         Contact contact = (Contact) o;
// 
//         if (id != contact.id) return false;
// 
//         return true;
//     }
// 
//     @Override
//     public int hashCode() {
//         return (int) (id ^ (id >>> 32));
//     }
// 
//     @Override
//     public int compareTo(Contact another) {
//         return name.compareTo(another.name);
//     }
// 
//     @Override
//     public int getRenderableId() {
//         if (LayoutMode.LIST.equals(mode)) {
//             return R.layout.listitem_contact;
//         } else {
//             return R.layout.griditem_contact;
//         }
//     }
// 
//     @Override
//     public Contact update(Contact other) {
//         return this;
//     }
// 
//     public void setLayoutMode(LayoutMode layoutMode) {
//         this.mode = layoutMode;
//     }
// 
//     public enum LayoutMode {
//         LIST,
//         GRID,
//         STAGGER
//     }
// }
// 
// Path: app/src/main/java/com/sefford/material/sample/contacts/details/ui/model/ContactData.java
// public class ContactData implements Renderable {
// 
//     final List<String> elements;
//     final int resource;
//     final int renderableId;
// 
//     public ContactData(List<String> elements, int resource, int renderableId) {
//         this.elements = elements;
//         this.resource = resource;
//         this.renderableId = renderableId;
//     }
// 
//     public List<String> getElements() {
//         return elements;
//     }
// 
//     public int getResource() {
//         return resource;
//     }
// 
// 
//     @Override
//     public int getRenderableId() {
//         return renderableId;
//     }
// }


// Path: app/src/main/java/com/sefford/material/sample/contacts/details/responses/GetContactResponse.java
import com.sefford.kor.responses.Response;
import com.sefford.material.sample.common.model.Contact;
import com.sefford.material.sample.contacts.details.ui.model.ContactData;

/*
 * Copyright (C) 2015 Saúl Díaz
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sefford.material.sample.contacts.details.responses;


/**
 * Contact Response with the information to populate the UI.
 */
public class GetContactResponse implements Response {

    final Contact contact;
    final ContactData phones;
    final ContactData mails;

    public GetContactResponse(Contact contact, ContactData phones, ContactData mails) {
        this.contact = contact;
        this.phones = phones;
        this.mails = mails;
    }

    @Override
    public boolean isSuccess() {
        return true;
    }

    @Override
    public boolean isFromNetwork() {
        return false;
    }

    public Contact getContact() {
        return contact;
    }

    public ContactData getPhones() {