diff options
Diffstat (limited to 'app/src/main/java/fr/gouv/etalab/mastodon/client/Entities/StoredStatus.java')
-rw-r--r-- | app/src/main/java/fr/gouv/etalab/mastodon/client/Entities/StoredStatus.java | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/client/Entities/StoredStatus.java b/app/src/main/java/fr/gouv/etalab/mastodon/client/Entities/StoredStatus.java index 82d0c428b..6062fbad6 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/client/Entities/StoredStatus.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/client/Entities/StoredStatus.java @@ -1,5 +1,8 @@ package fr.gouv.etalab.mastodon.client.Entities; +import android.os.Parcel; +import android.os.Parcelable; + import java.util.Date; @@ -8,7 +11,7 @@ import java.util.Date; * Manage Stored status */ -public class StoredStatus { +public class StoredStatus implements Parcelable { private int id; private Date creation_date; @@ -20,6 +23,7 @@ public class StoredStatus { private Status statusReply; private String instance; private String userId; + private String scheduledServerdId; public int getId() { return id; @@ -101,4 +105,65 @@ public class StoredStatus { public void setStatusReply(Status statusReply) { this.statusReply = statusReply; } + + + public String getScheduledServerdId() { + return scheduledServerdId; + } + + public void setScheduledServerdId(String scheduledServerdId) { + this.scheduledServerdId = scheduledServerdId; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(this.id); + dest.writeLong(this.creation_date != null ? this.creation_date.getTime() : -1); + dest.writeLong(this.scheduled_date != null ? this.scheduled_date.getTime() : -1); + dest.writeLong(this.sent_date != null ? this.sent_date.getTime() : -1); + dest.writeInt(this.jobId); + dest.writeByte(this.isSent ? (byte) 1 : (byte) 0); + dest.writeParcelable(this.status, flags); + dest.writeParcelable(this.statusReply, flags); + dest.writeString(this.instance); + dest.writeString(this.userId); + dest.writeString(this.scheduledServerdId); + } + + public StoredStatus() { + } + + protected StoredStatus(Parcel in) { + this.id = in.readInt(); + long tmpCreation_date = in.readLong(); + this.creation_date = tmpCreation_date == -1 ? null : new Date(tmpCreation_date); + long tmpScheduled_date = in.readLong(); + this.scheduled_date = tmpScheduled_date == -1 ? null : new Date(tmpScheduled_date); + long tmpSent_date = in.readLong(); + this.sent_date = tmpSent_date == -1 ? null : new Date(tmpSent_date); + this.jobId = in.readInt(); + this.isSent = in.readByte() != 0; + this.status = in.readParcelable(Status.class.getClassLoader()); + this.statusReply = in.readParcelable(Status.class.getClassLoader()); + this.instance = in.readString(); + this.userId = in.readString(); + this.scheduledServerdId = in.readString(); + } + + public static final Creator<StoredStatus> CREATOR = new Creator<StoredStatus>() { + @Override + public StoredStatus createFromParcel(Parcel source) { + return new StoredStatus(source); + } + + @Override + public StoredStatus[] newArray(int size) { + return new StoredStatus[size]; + } + }; } |