/* * Copyright 2012 Tallinn University Centre for Educational Technology * * 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 ee.htk.dippler.app.entities; import android.os.Parcel; import android.os.Parcelable; public class Comment implements Parcelable { private String postTitle; private String createdDate; private String body; private String creator; private String url; public String getPostTitle() { return postTitle; } public void setPostTitle(String postTitle) { this.postTitle = postTitle; } public String getCreatedDate() { return createdDate; } public void setCreatedDate(String createdDate) { this.createdDate = createdDate; } public String getBody() { return body; } public void setBody(String body) { this.body = body; } public String getCreator() { return creator; } public void setCreator(String creator) { this.creator = creator; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public Comment getInstance() { Comment new_instance = new Comment(); new_instance.setBody(body); new_instance.setCreatedDate(createdDate); new_instance.setCreator(creator); new_instance.setPostTitle(postTitle); new_instance.setUrl(url); return new_instance; } @Override public int describeContents() { // TODO Auto-generated method stub return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(postTitle); dest.writeString(body); dest.writeString(creator); dest.writeString(createdDate); dest.writeString(url); } public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public Comment createFromParcel(Parcel in) { return new Comment(in); } public Comment[] newArray(int size) { return new Comment[size]; } }; private Comment(Parcel in) { postTitle = in.readString(); body = in.readString(); creator = in.readString(); createdDate = in.readString(); url = in.readString(); } public Comment() { } }