001package com.box.sdkgen.schemas.aicitation; 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/** The citation of the LLM's answer reference. */ 012@JsonFilter("nullablePropertyFilter") 013public class AiCitation extends SerializableObject { 014 015 /** The specific content from where the answer was referenced. */ 016 protected String content; 017 018 /** The id of the item. */ 019 protected String id; 020 021 /** The type of the item. */ 022 @JsonDeserialize(using = AiCitationTypeField.AiCitationTypeFieldDeserializer.class) 023 @JsonSerialize(using = AiCitationTypeField.AiCitationTypeFieldSerializer.class) 024 protected EnumWrapper<AiCitationTypeField> type; 025 026 /** The name of the item. */ 027 protected String name; 028 029 public AiCitation() { 030 super(); 031 } 032 033 protected AiCitation(Builder builder) { 034 super(); 035 this.content = builder.content; 036 this.id = builder.id; 037 this.type = builder.type; 038 this.name = builder.name; 039 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 040 } 041 042 public String getContent() { 043 return content; 044 } 045 046 public String getId() { 047 return id; 048 } 049 050 public EnumWrapper<AiCitationTypeField> getType() { 051 return type; 052 } 053 054 public String getName() { 055 return name; 056 } 057 058 @Override 059 public boolean equals(Object o) { 060 if (this == o) { 061 return true; 062 } 063 if (o == null || getClass() != o.getClass()) { 064 return false; 065 } 066 AiCitation casted = (AiCitation) o; 067 return Objects.equals(content, casted.content) 068 && Objects.equals(id, casted.id) 069 && Objects.equals(type, casted.type) 070 && Objects.equals(name, casted.name); 071 } 072 073 @Override 074 public int hashCode() { 075 return Objects.hash(content, id, type, name); 076 } 077 078 @Override 079 public String toString() { 080 return "AiCitation{" 081 + "content='" 082 + content 083 + '\'' 084 + ", " 085 + "id='" 086 + id 087 + '\'' 088 + ", " 089 + "type='" 090 + type 091 + '\'' 092 + ", " 093 + "name='" 094 + name 095 + '\'' 096 + "}"; 097 } 098 099 public static class Builder extends NullableFieldTracker { 100 101 protected String content; 102 103 protected String id; 104 105 protected EnumWrapper<AiCitationTypeField> type; 106 107 protected String name; 108 109 public Builder content(String content) { 110 this.content = content; 111 return this; 112 } 113 114 public Builder id(String id) { 115 this.id = id; 116 return this; 117 } 118 119 public Builder type(AiCitationTypeField type) { 120 this.type = new EnumWrapper<AiCitationTypeField>(type); 121 return this; 122 } 123 124 public Builder type(EnumWrapper<AiCitationTypeField> type) { 125 this.type = type; 126 return this; 127 } 128 129 public Builder name(String name) { 130 this.name = name; 131 return this; 132 } 133 134 public AiCitation build() { 135 return new AiCitation(this); 136 } 137 } 138}