001package com.box.sdkgen.schemas.commentfull;
002
003import com.box.sdkgen.schemas.comment.Comment;
004import com.box.sdkgen.schemas.comment.CommentItemField;
005import com.box.sdkgen.schemas.commentbase.CommentBaseTypeField;
006import com.box.sdkgen.schemas.usermini.UserMini;
007import com.box.sdkgen.serialization.json.EnumWrapper;
008import com.fasterxml.jackson.annotation.JsonFilter;
009import com.fasterxml.jackson.annotation.JsonProperty;
010import java.time.OffsetDateTime;
011import java.util.Objects;
012
013/**
014 * Comments are messages created on files. Comments can be made independently or created as
015 * responses to other comments.
016 */
017@JsonFilter("nullablePropertyFilter")
018public class CommentFull extends Comment {
019
020  /**
021   * The string representing the comment text with @mentions included. @mention format is
022   * @[id:username] where `id` is user's Box ID and `username` is their display name.
023   */
024  @JsonProperty("tagged_message")
025  protected String taggedMessage;
026
027  public CommentFull() {
028    super();
029  }
030
031  protected CommentFull(Builder builder) {
032    super(builder);
033    this.taggedMessage = builder.taggedMessage;
034    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
035  }
036
037  public String getTaggedMessage() {
038    return taggedMessage;
039  }
040
041  @Override
042  public boolean equals(Object o) {
043    if (this == o) {
044      return true;
045    }
046    if (o == null || getClass() != o.getClass()) {
047      return false;
048    }
049    CommentFull casted = (CommentFull) o;
050    return Objects.equals(id, casted.id)
051        && Objects.equals(type, casted.type)
052        && Objects.equals(isReplyComment, casted.isReplyComment)
053        && Objects.equals(message, casted.message)
054        && Objects.equals(createdBy, casted.createdBy)
055        && Objects.equals(createdAt, casted.createdAt)
056        && Objects.equals(modifiedAt, casted.modifiedAt)
057        && Objects.equals(item, casted.item)
058        && Objects.equals(taggedMessage, casted.taggedMessage);
059  }
060
061  @Override
062  public int hashCode() {
063    return Objects.hash(
064        id, type, isReplyComment, message, createdBy, createdAt, modifiedAt, item, taggedMessage);
065  }
066
067  @Override
068  public String toString() {
069    return "CommentFull{"
070        + "id='"
071        + id
072        + '\''
073        + ", "
074        + "type='"
075        + type
076        + '\''
077        + ", "
078        + "isReplyComment='"
079        + isReplyComment
080        + '\''
081        + ", "
082        + "message='"
083        + message
084        + '\''
085        + ", "
086        + "createdBy='"
087        + createdBy
088        + '\''
089        + ", "
090        + "createdAt='"
091        + createdAt
092        + '\''
093        + ", "
094        + "modifiedAt='"
095        + modifiedAt
096        + '\''
097        + ", "
098        + "item='"
099        + item
100        + '\''
101        + ", "
102        + "taggedMessage='"
103        + taggedMessage
104        + '\''
105        + "}";
106  }
107
108  public static class Builder extends Comment.Builder {
109
110    protected String taggedMessage;
111
112    public Builder taggedMessage(String taggedMessage) {
113      this.taggedMessage = taggedMessage;
114      return this;
115    }
116
117    @Override
118    public Builder id(String id) {
119      this.id = id;
120      return this;
121    }
122
123    @Override
124    public Builder type(CommentBaseTypeField type) {
125      this.type = new EnumWrapper<CommentBaseTypeField>(type);
126      return this;
127    }
128
129    @Override
130    public Builder type(EnumWrapper<CommentBaseTypeField> type) {
131      this.type = type;
132      return this;
133    }
134
135    @Override
136    public Builder isReplyComment(Boolean isReplyComment) {
137      this.isReplyComment = isReplyComment;
138      return this;
139    }
140
141    @Override
142    public Builder message(String message) {
143      this.message = message;
144      return this;
145    }
146
147    @Override
148    public Builder createdBy(UserMini createdBy) {
149      this.createdBy = createdBy;
150      return this;
151    }
152
153    @Override
154    public Builder createdAt(OffsetDateTime createdAt) {
155      this.createdAt = createdAt;
156      return this;
157    }
158
159    @Override
160    public Builder modifiedAt(OffsetDateTime modifiedAt) {
161      this.modifiedAt = modifiedAt;
162      return this;
163    }
164
165    @Override
166    public Builder item(CommentItemField item) {
167      this.item = item;
168      return this;
169    }
170
171    public CommentFull build() {
172      return new CommentFull(this);
173    }
174  }
175}