com.factset.sdk.IRNNotes.models.CommentDto Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of irnnotes Show documentation
Show all versions of irnnotes Show documentation
FactSet SDK for Java - irnnotes
/*
* IRN API v1
* Allows users to extract, create, update and configure IRN data.
*
* The version of the OpenAPI document: 1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.factset.sdk.IRNNotes.models;
import java.util.Objects;
import java.util.Arrays;
import java.util.Map;
import java.util.HashMap;
import com.factset.sdk.IRNNotes.models.AttachmentSummaryDto;
import com.factset.sdk.IRNNotes.models.SubcommentSummaryDto;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.factset.sdk.IRNNotes.JSON;
/**
* CommentDto
*/
@JsonPropertyOrder({
CommentDto.JSON_PROPERTY_ID,
CommentDto.JSON_PROPERTY_AUTHOR_ID,
CommentDto.JSON_PROPERTY_PARENT_COMMENT_ID,
CommentDto.JSON_PROPERTY_BODY,
CommentDto.JSON_PROPERTY_CREATED_AT,
CommentDto.JSON_PROPERTY_ATTACHMENTS,
CommentDto.JSON_PROPERTY_SUBCOMMENTS
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class CommentDto implements Serializable {
private static final long serialVersionUID = 1L;
public static final String JSON_PROPERTY_ID = "id";
private java.util.UUID id;
public static final String JSON_PROPERTY_AUTHOR_ID = "authorId";
private java.util.UUID authorId;
public static final String JSON_PROPERTY_PARENT_COMMENT_ID = "parentCommentId";
private JsonNullable parentCommentId = JsonNullable.undefined();
public static final String JSON_PROPERTY_BODY = "body";
private JsonNullable body = JsonNullable.undefined();
public static final String JSON_PROPERTY_CREATED_AT = "createdAt";
private JsonNullable createdAt = JsonNullable.undefined();
public static final String JSON_PROPERTY_ATTACHMENTS = "attachments";
private JsonNullable> attachments = JsonNullable.>undefined();
public static final String JSON_PROPERTY_SUBCOMMENTS = "subcomments";
private JsonNullable> subcomments = JsonNullable.>undefined();
public CommentDto() {
}
public CommentDto id(java.util.UUID id) {
this.id = id;
return this;
}
/**
* Get id
* @return id
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public java.util.UUID getId() {
return id;
}
@JsonProperty(JSON_PROPERTY_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setId(java.util.UUID id) {
this.id = id;
}
public CommentDto authorId(java.util.UUID authorId) {
this.authorId = authorId;
return this;
}
/**
* Get authorId
* @return authorId
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_AUTHOR_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public java.util.UUID getAuthorId() {
return authorId;
}
@JsonProperty(JSON_PROPERTY_AUTHOR_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setAuthorId(java.util.UUID authorId) {
this.authorId = authorId;
}
public CommentDto parentCommentId(java.util.UUID parentCommentId) {
this.parentCommentId = JsonNullable.of(parentCommentId);
return this;
}
/**
* Get parentCommentId
* @return parentCommentId
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonIgnore
public java.util.UUID getParentCommentId() {
return parentCommentId.orElse(null);
}
@JsonProperty(JSON_PROPERTY_PARENT_COMMENT_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getParentCommentId_JsonNullable() {
return parentCommentId;
}
@JsonProperty(JSON_PROPERTY_PARENT_COMMENT_ID)
public void setParentCommentId_JsonNullable(JsonNullable parentCommentId) {
this.parentCommentId = parentCommentId;
}
public void setParentCommentId(java.util.UUID parentCommentId) {
this.parentCommentId = JsonNullable.of(parentCommentId);
}
public CommentDto body(String body) {
this.body = JsonNullable.of(body);
return this;
}
/**
* Get body
* @return body
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonIgnore
public String getBody() {
return body.orElse(null);
}
@JsonProperty(JSON_PROPERTY_BODY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getBody_JsonNullable() {
return body;
}
@JsonProperty(JSON_PROPERTY_BODY)
public void setBody_JsonNullable(JsonNullable body) {
this.body = body;
}
public void setBody(String body) {
this.body = JsonNullable.of(body);
}
public CommentDto createdAt(String createdAt) {
this.createdAt = JsonNullable.of(createdAt);
return this;
}
/**
* Get createdAt
* @return createdAt
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonIgnore
public String getCreatedAt() {
return createdAt.orElse(null);
}
@JsonProperty(JSON_PROPERTY_CREATED_AT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable getCreatedAt_JsonNullable() {
return createdAt;
}
@JsonProperty(JSON_PROPERTY_CREATED_AT)
public void setCreatedAt_JsonNullable(JsonNullable createdAt) {
this.createdAt = createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = JsonNullable.of(createdAt);
}
public CommentDto attachments(java.util.List attachments) {
this.attachments = JsonNullable.>of(attachments);
return this;
}
public CommentDto addAttachmentsItem(AttachmentSummaryDto attachmentsItem) {
if (this.attachments == null || !this.attachments.isPresent()) {
this.attachments = JsonNullable.>of(new java.util.ArrayList<>());
}
try {
this.attachments.get().add(attachmentsItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/**
* Get attachments
* @return attachments
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonIgnore
public java.util.List getAttachments() {
return attachments.orElse(null);
}
@JsonProperty(JSON_PROPERTY_ATTACHMENTS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable> getAttachments_JsonNullable() {
return attachments;
}
@JsonProperty(JSON_PROPERTY_ATTACHMENTS)
public void setAttachments_JsonNullable(JsonNullable> attachments) {
this.attachments = attachments;
}
public void setAttachments(java.util.List attachments) {
this.attachments = JsonNullable.>of(attachments);
}
public CommentDto subcomments(java.util.List subcomments) {
this.subcomments = JsonNullable.>of(subcomments);
return this;
}
public CommentDto addSubcommentsItem(SubcommentSummaryDto subcommentsItem) {
if (this.subcomments == null || !this.subcomments.isPresent()) {
this.subcomments = JsonNullable.>of(new java.util.ArrayList<>());
}
try {
this.subcomments.get().add(subcommentsItem);
} catch (java.util.NoSuchElementException e) {
// this can never happen, as we make sure above that the value is present
}
return this;
}
/**
* Get subcomments
* @return subcomments
**/
@jakarta.annotation.Nullable
@ApiModelProperty(value = "")
@JsonIgnore
public java.util.List getSubcomments() {
return subcomments.orElse(null);
}
@JsonProperty(JSON_PROPERTY_SUBCOMMENTS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public JsonNullable> getSubcomments_JsonNullable() {
return subcomments;
}
@JsonProperty(JSON_PROPERTY_SUBCOMMENTS)
public void setSubcomments_JsonNullable(JsonNullable> subcomments) {
this.subcomments = subcomments;
}
public void setSubcomments(java.util.List subcomments) {
this.subcomments = JsonNullable.>of(subcomments);
}
/**
* Return true if this CommentDto object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CommentDto commentDto = (CommentDto) o;
return Objects.equals(this.id, commentDto.id) &&
Objects.equals(this.authorId, commentDto.authorId) &&
equalsNullable(this.parentCommentId, commentDto.parentCommentId) &&
equalsNullable(this.body, commentDto.body) &&
equalsNullable(this.createdAt, commentDto.createdAt) &&
equalsNullable(this.attachments, commentDto.attachments) &&
equalsNullable(this.subcomments, commentDto.subcomments);
}
private static boolean equalsNullable(JsonNullable a, JsonNullable b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(id, authorId, hashCodeNullable(parentCommentId), hashCodeNullable(body), hashCodeNullable(createdAt), hashCodeNullable(attachments), hashCodeNullable(subcomments));
}
private static int hashCodeNullable(JsonNullable a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CommentDto {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" authorId: ").append(toIndentedString(authorId)).append("\n");
sb.append(" parentCommentId: ").append(toIndentedString(parentCommentId)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).append("\n");
sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
sb.append(" attachments: ").append(toIndentedString(attachments)).append("\n");
sb.append(" subcomments: ").append(toIndentedString(subcomments)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}