Android Open Source - inbox-android Thread






From Project

Back to project page inbox-android.

License

The source code is released under:

MIT License

If you think the Android project inbox-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.inboxapp.androidsdk.json_objects.single_objects;
/*from www .java2s  .  co m*/
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.inboxapp.androidsdk.apis.InboxAppClient;
import com.inboxapp.androidsdk.json_objects.collection_objects.ParticipantList;
import com.inboxapp.androidsdk.json_objects.collection_objects.TagList;
import com.inboxapp.androidsdk.json_objects.single_objects.base.InboxAppSingleObject;
import com.inboxapp.androidsdk.json_objects.single_objects.body_objects.TagEdit;
import com.inboxapp.androidsdk.utils.InboxAppStringUtils;

import org.apache.commons.lang.builder.ToStringBuilder;

import java.io.Serializable;
import java.util.ArrayList;

import retrofit.Callback;
import retrofit.client.Response;

/**
 * Created by sylvianguessan on 8/7/14.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class Thread implements Serializable, InboxAppSingleObject {

    @JsonProperty("id")
    String id;
    @JsonProperty("object")
    String object;
    @JsonProperty("namespace")
    String namespace;
    @JsonProperty("subject")
    String subject;
    @JsonProperty("last_message_timestamp")
    long last_message_timestamp;
    @JsonProperty("first_message_timestamp")
    long first_message_timestamp;
    @JsonProperty("snippet")
    String snippet;
    @JsonProperty("participants")
    ParticipantList participants;
    @JsonProperty("tags")
    TagList tags;
    @JsonProperty("messages")
    ArrayList<String> messages;
    @JsonProperty("drafts")
    ArrayList<String> drafts;


    public String getId(){return id;}
    public void setId(String s){id=s;}
    public String getObject(){return object;}
    public void setObject(String s){object=s;}
    public String getNamespace(){return namespace;}
    public void setNamespace(String s){namespace=s;}
    public String getSubject(){return subject;}
    public void setSubject(String s){subject=s;}
    public long getLastMessageTimestamp(){return last_message_timestamp;}
    public void setLastMessageTimestamp(long l){last_message_timestamp=l;}
    public long getFirstMessageTimestamp(){return first_message_timestamp;}
    public void setFirstMessageTimestamp(long l){first_message_timestamp=l;}
    public String getSnippet(){return snippet;}
    public void setSnippet(String s){snippet=s;}
    public ParticipantList getParticipants(){return participants;}
    public void setParticipants(ParticipantList l){
        participants =l;}
    public TagList getTags(){return tags;}
    public void setTags(TagList l){
        tags =l;}
    public ArrayList<String> getMessages(){return messages;}
    public void setMessages(ArrayList<String> l){
        messages =l;}
    public ArrayList<String> getDrafts(){return drafts;}
    public void setDrafts(ArrayList<String> l){
        drafts =l;}

    @Override
    public String toString()
    {
        return ToStringBuilder.reflectionToString(this);
    }
    public String memberTypesValue()
    {
        return  "id: "+id+"\n"
                +"object: "+object+"\n"
                +"namespace: "+namespace+"\n"
                +"subject: "+subject+"\n"
                +"last_message_timestamp: "+last_message_timestamp+"\n"
                +"first_message_timestamp: "+first_message_timestamp+"\n"
                +"snippet: "+snippet+"\n"
                +"participants: "+InboxAppStringUtils.StringUtils.getAllParticipantsString(participants)+"\n"
                +"tags: "+InboxAppStringUtils.StringUtils.getAllTagsString(tags)+"\n"
                +"message_reference_list (messages): "+ InboxAppStringUtils.StringUtils.getAllString(messages)+ "\n"
                +"draft_reference_list (drafts): "+ InboxAppStringUtils.StringUtils.getAllString(drafts)+ "\n";

    }




    public void archiveWithCallback(InboxAppClient inboxAppClient)
    {
        ArrayList<String>addList = new ArrayList<String>();
        addList.add("archive");
        ArrayList<String>removeList = new ArrayList<String>();
        removeList.add("inbox");
        TagEdit tagEdit = new TagEdit(addList, removeList);
        inboxAppClient.updateThreadTags(namespace, id, tagEdit);
    }
    public void unarchiveWithCallback(InboxAppClient inboxAppClient)
    {
        ArrayList<String>addList = new ArrayList<String>();
        addList.add("inbox");
        ArrayList<String>removeList = new ArrayList<String>();
        removeList.add("archive");
        TagEdit tagEdit = new TagEdit(addList, removeList);
        inboxAppClient.updateThreadTags(namespace, id, tagEdit);

    }
    public void markAsUnread(InboxAppClient inboxAppClient)
    {
        ArrayList<String>addList = new ArrayList<String>();
        addList.add("unread");
        ArrayList<String>removeList = new ArrayList<String>();
        TagEdit tagEdit = new TagEdit(addList, removeList);
        inboxAppClient.updateThreadTags(namespace, id, tagEdit);

    }
    public void markAsStarredOrFlagged(InboxAppClient inboxAppClient)
    {
        ArrayList<String>addList = new ArrayList<String>();
        addList.add("starred");
        ArrayList<String>removeList = new ArrayList<String>();
        TagEdit tagEdit = new TagEdit(addList, removeList);
        inboxAppClient.updateThreadTags(namespace, id, tagEdit);
    }
    public void markAsSeen(InboxAppClient inboxAppClient)
    {
        ArrayList<String>addList = new ArrayList<String>();
        ArrayList<String>removeList = new ArrayList<String>();
        removeList.add("unseen");
        TagEdit tagEdit = new TagEdit(addList, removeList);
        inboxAppClient.updateThreadTags(namespace, id, tagEdit);
    }
    public void markAsRead(InboxAppClient inboxAppClient)
    {
        ArrayList<String>addList = new ArrayList<String>();
        ArrayList<String>removeList = new ArrayList<String>();
        removeList.add("unread");
        TagEdit tagEdit = new TagEdit(addList, removeList);
        inboxAppClient.updateThreadTags(namespace, id, tagEdit);
    }
    public void markAsUnStarredOrUnFlagged(InboxAppClient inboxAppClient)
    {
        ArrayList<String>addList = new ArrayList<String>();
        ArrayList<String>removeList = new ArrayList<String>();
        removeList.add("starred");
        TagEdit tagEdit = new TagEdit(addList, removeList);
        inboxAppClient.updateThreadTags(namespace, id, tagEdit);

    }
}




Java Source Code List

com.inboxapp.androidapplication.MainActivity.java
com.inboxapp.androidsdk.apis.InboxAppClient.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTaskCallback.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTaskQueue.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxTaskID.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.CreateCustomTagTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.CreateDraftWithBodyTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.SendDraftWithBodyTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.SendDraftWithIDTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.UpdateThreadTagsTask.java
com.inboxapp.androidsdk.apis.taskmanagement.InboxAppTasks.base.InboxAppTask.java
com.inboxapp.androidsdk.json_objects.collection_objects.ContactList.java
com.inboxapp.androidsdk.json_objects.collection_objects.DraftList.java
com.inboxapp.androidsdk.json_objects.collection_objects.FileList.java
com.inboxapp.androidsdk.json_objects.collection_objects.MessageList.java
com.inboxapp.androidsdk.json_objects.collection_objects.NameSpaceList.java
com.inboxapp.androidsdk.json_objects.collection_objects.ParticipantList.java
com.inboxapp.androidsdk.json_objects.collection_objects.TagList.java
com.inboxapp.androidsdk.json_objects.collection_objects.ThreadList.java
com.inboxapp.androidsdk.json_objects.single_objects.Contact.java
com.inboxapp.androidsdk.json_objects.single_objects.Draft.java
com.inboxapp.androidsdk.json_objects.single_objects.File.java
com.inboxapp.androidsdk.json_objects.single_objects.Message.java
com.inboxapp.androidsdk.json_objects.single_objects.Namespace.java
com.inboxapp.androidsdk.json_objects.single_objects.Participant.java
com.inboxapp.androidsdk.json_objects.single_objects.Tag.java
com.inboxapp.androidsdk.json_objects.single_objects.Thread.java
com.inboxapp.androidsdk.json_objects.single_objects.base.InboxAppSingleObject.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.DraftID.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.TagEdit.java
com.inboxapp.androidsdk.json_objects.single_objects.body_objects.TagName.java
com.inboxapp.androidsdk.sample_application.SampleArrayAdapter.java
com.inboxapp.androidsdk.sample_application.SampleDetailsActivity.java
com.inboxapp.androidsdk.sample_application.SampleMenuActivity.java
com.inboxapp.androidsdk.scratchpad.Scratchpad_MainActivity.java
com.inboxapp.androidsdk.scratchpad.scratchpad_apis.JacksonContributor.java
com.inboxapp.androidsdk.scratchpad.scratchpad_apis.TestApi.java
com.inboxapp.androidsdk.utils.InboxAppStringUtils.java