mirror of
https://github.com/k0shk0sh/FastHub.git
synced 2025-12-08 19:05:54 +00:00
103 lines
3.3 KiB
Java
103 lines
3.3 KiB
Java
package com.fastaccess.data.dao;
|
|
|
|
import android.os.Parcel;
|
|
import android.os.Parcelable;
|
|
|
|
import com.fastaccess.data.dao.model.User;
|
|
import com.fastaccess.data.dao.timeline.Timeline;
|
|
|
|
import java.util.Date;
|
|
|
|
import lombok.Getter;
|
|
import lombok.Setter;
|
|
|
|
/**
|
|
* Created by Kosh on 04 May 2017, 7:10 PM
|
|
*/
|
|
|
|
@Getter @Setter public class ReviewCommentModel extends Timeline implements Parcelable {
|
|
|
|
long id;
|
|
String url;
|
|
long pullRequestReviewId;
|
|
String diffHunk;
|
|
String path;
|
|
int position;
|
|
int originalPosition;
|
|
String commitId;
|
|
String originalCommitId;
|
|
User user;
|
|
String bodyHtml;
|
|
String body;
|
|
Date createdAt;
|
|
Date updatedAt;
|
|
String htmlUrl;
|
|
String pullRequestUrl;
|
|
ReactionsModel reactions;
|
|
|
|
public ReviewCommentModel() {}
|
|
|
|
@Override public int describeContents() { return 0; }
|
|
|
|
@Override public void writeToParcel(Parcel dest, int flags) {
|
|
dest.writeLong(this.id);
|
|
dest.writeString(this.url);
|
|
dest.writeLong(this.pullRequestReviewId);
|
|
dest.writeString(this.diffHunk);
|
|
dest.writeString(this.path);
|
|
dest.writeInt(this.position);
|
|
dest.writeInt(this.originalPosition);
|
|
dest.writeString(this.commitId);
|
|
dest.writeString(this.originalCommitId);
|
|
dest.writeParcelable(this.user, flags);
|
|
dest.writeString(this.bodyHtml);
|
|
dest.writeString(this.body);
|
|
dest.writeLong(this.createdAt != null ? this.createdAt.getTime() : -1);
|
|
dest.writeLong(this.updatedAt != null ? this.updatedAt.getTime() : -1);
|
|
dest.writeString(this.htmlUrl);
|
|
dest.writeString(this.pullRequestUrl);
|
|
dest.writeParcelable(this.reactions, flags);
|
|
}
|
|
|
|
protected ReviewCommentModel(Parcel in) {
|
|
this.id = in.readLong();
|
|
this.url = in.readString();
|
|
this.pullRequestReviewId = in.readLong();
|
|
this.diffHunk = in.readString();
|
|
this.path = in.readString();
|
|
this.position = in.readInt();
|
|
this.originalPosition = in.readInt();
|
|
this.commitId = in.readString();
|
|
this.originalCommitId = in.readString();
|
|
this.user = in.readParcelable(User.class.getClassLoader());
|
|
this.bodyHtml = in.readString();
|
|
this.body = in.readString();
|
|
long tmpCreatedAt = in.readLong();
|
|
this.createdAt = tmpCreatedAt == -1 ? null : new Date(tmpCreatedAt);
|
|
long tmpUpdatedAt = in.readLong();
|
|
this.updatedAt = tmpUpdatedAt == -1 ? null : new Date(tmpUpdatedAt);
|
|
this.htmlUrl = in.readString();
|
|
this.pullRequestUrl = in.readString();
|
|
this.reactions = in.readParcelable(ReactionsModel.class.getClassLoader());
|
|
}
|
|
|
|
public static final Creator<ReviewCommentModel> CREATOR = new Creator<ReviewCommentModel>() {
|
|
@Override public ReviewCommentModel createFromParcel(Parcel source) {return new ReviewCommentModel(source);}
|
|
|
|
@Override public ReviewCommentModel[] newArray(int size) {return new ReviewCommentModel[size];}
|
|
};
|
|
|
|
@Override public boolean equals(Object o) {
|
|
if (this == o) return true;
|
|
if (o == null || getClass() != o.getClass()) return false;
|
|
|
|
ReviewCommentModel that = (ReviewCommentModel) o;
|
|
|
|
return id == that.id;
|
|
}
|
|
|
|
@Override public int hashCode() {
|
|
return (int) (id ^ (id >>> 32));
|
|
}
|
|
}
|