001package com.box.sdkgen.schemas.commentbase; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.box.sdkgen.serialization.json.EnumWrapper; 006import com.fasterxml.jackson.annotation.JsonFilter; 007import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 008import com.fasterxml.jackson.databind.annotation.JsonSerialize; 009import java.util.Objects; 010 011/** Base representation of a comment. */ 012@JsonFilter("nullablePropertyFilter") 013public class CommentBase extends SerializableObject { 014 015 /** The unique identifier for this comment. */ 016 protected String id; 017 018 /** The value will always be `comment`. */ 019 @JsonDeserialize(using = CommentBaseTypeField.CommentBaseTypeFieldDeserializer.class) 020 @JsonSerialize(using = CommentBaseTypeField.CommentBaseTypeFieldSerializer.class) 021 protected EnumWrapper<CommentBaseTypeField> type; 022 023 public CommentBase() { 024 super(); 025 } 026 027 protected CommentBase(Builder builder) { 028 super(); 029 this.id = builder.id; 030 this.type = builder.type; 031 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 032 } 033 034 public String getId() { 035 return id; 036 } 037 038 public EnumWrapper<CommentBaseTypeField> getType() { 039 return type; 040 } 041 042 @Override 043 public boolean equals(Object o) { 044 if (this == o) { 045 return true; 046 } 047 if (o == null || getClass() != o.getClass()) { 048 return false; 049 } 050 CommentBase casted = (CommentBase) o; 051 return Objects.equals(id, casted.id) && Objects.equals(type, casted.type); 052 } 053 054 @Override 055 public int hashCode() { 056 return Objects.hash(id, type); 057 } 058 059 @Override 060 public String toString() { 061 return "CommentBase{" + "id='" + id + '\'' + ", " + "type='" + type + '\'' + "}"; 062 } 063 064 public static class Builder extends NullableFieldTracker { 065 066 protected String id; 067 068 protected EnumWrapper<CommentBaseTypeField> type; 069 070 public Builder id(String id) { 071 this.id = id; 072 return this; 073 } 074 075 public Builder type(CommentBaseTypeField type) { 076 this.type = new EnumWrapper<CommentBaseTypeField>(type); 077 return this; 078 } 079 080 public Builder type(EnumWrapper<CommentBaseTypeField> type) { 081 this.type = type; 082 return this; 083 } 084 085 public CommentBase build() { 086 return new CommentBase(this); 087 } 088 } 089}