Android Open Source - Android-MultiPaneStream Message Impl






From Project

Back to project page Android-MultiPaneStream.

License

The source code is released under:

Apache License

If you think the Android project Android-MultiPaneStream 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 net.ichigotake.multipanestream.sdk;
// w  ww . java 2  s  .  c o  m
import android.os.Parcel;

final class MessageImpl implements Message, android.os.Parcelable {

    private final long timestamp;
    private final String title;
    private final String body;
    private final Channel channel;
    private final Joiner author;

    public MessageImpl(MessageBuilder builder) {
        this.timestamp = builder.timestamp;
        this.title = builder.title.toString();
        this.body = builder.message.toString();
        this.channel = builder.channel;
        this.author = builder.author;
    }

    @Override
    public long getTimestamp() {
        return timestamp;
    }

    @Override
    public CharSequence getTitle() {
        return title;
    }

    @Override
    public CharSequence getBody() {
        return body;
    }

    @Override
    public Channel getChannel() {
        return channel;
    }

    @Override
    public Joiner getAuthor() {
        return author;
    }

    @Override
    public String toString() {
        return String.format("%s[ %s ] %s: %s", timestamp, channel.getName(), title, body);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(this.timestamp);
        dest.writeString(this.title);
        dest.writeString(this.body);
        dest.writeParcelable(this.channel, 0);
        dest.writeParcelable(this.author, 0);
    }

    private MessageImpl(Parcel in) {
        this.timestamp = in.readLong();
        this.title = in.readString();
        this.body = in.readString();
        this.channel = in.readParcelable(Channel.class.getClassLoader());
        this.author = in.readParcelable(Joiner.class.getClassLoader());
    }

    public static final Creator<MessageImpl> CREATOR = new Creator<MessageImpl>() {
        public MessageImpl createFromParcel(Parcel source) {
            return new MessageImpl(source);
        }

        public MessageImpl[] newArray(int size) {
            return new MessageImpl[size];
        }
    };
}




Java Source Code List

net.ichigotake.multipanestream.ApplicationTest.java
net.ichigotake.multipanestream.app.tablet.TabletMultiPaneStreamActivity.java
net.ichigotake.multipanestream.attribute.channel.ChannelAdapter.java
net.ichigotake.multipanestream.attribute.channel.ChannelTreeExpandableListCollection.java
net.ichigotake.multipanestream.attribute.channel.ChannelTreeFragment.java
net.ichigotake.multipanestream.attribute.channel.OnChannelSelectedListener.java
net.ichigotake.multipanestream.attribute.joiner.JoinerAdapter.java
net.ichigotake.multipanestream.attribute.joiner.JoinerFragment.java
net.ichigotake.multipanestream.sdk.ChannelBuilder.java
net.ichigotake.multipanestream.sdk.ChannelCategoryBuilder.java
net.ichigotake.multipanestream.sdk.ChannelCategoryImpl.java
net.ichigotake.multipanestream.sdk.ChannelCategory.java
net.ichigotake.multipanestream.sdk.ChannelImpl.java
net.ichigotake.multipanestream.sdk.ChannelJoiners.java
net.ichigotake.multipanestream.sdk.ChannelTree.java
net.ichigotake.multipanestream.sdk.Channel.java
net.ichigotake.multipanestream.sdk.JoinerBuilder.java
net.ichigotake.multipanestream.sdk.JoinerImpl.java
net.ichigotake.multipanestream.sdk.Joiner.java
net.ichigotake.multipanestream.sdk.MessageBuilder.java
net.ichigotake.multipanestream.sdk.MessageImpl.java
net.ichigotake.multipanestream.sdk.Message.java
net.ichigotake.multipanestream.stream.LogStreamFragment.java
net.ichigotake.multipanestream.stream.MainStreamFragment.java
net.ichigotake.multipanestream.stream.MessageView.java
net.ichigotake.multipanestream.stream.StreamAdapter.java
net.ichigotake.multipanestream.stream.StreamContainer.java