001package com.box.sdkgen.schemas.v2025r0.hubparagraphtextblockv2025r0; 002 003import com.box.sdkgen.schemas.v2025r0.hubdocumentblockv2025r0.HubDocumentBlockV2025R0; 004import com.box.sdkgen.serialization.json.EnumWrapper; 005import com.fasterxml.jackson.annotation.JsonFilter; 006import com.fasterxml.jackson.annotation.JsonProperty; 007import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 008import com.fasterxml.jackson.databind.annotation.JsonSerialize; 009import java.util.Objects; 010 011/** A paragraph block in the Box Hub Document. */ 012@JsonFilter("nullablePropertyFilter") 013public class HubParagraphTextBlockV2025R0 extends HubDocumentBlockV2025R0 { 014 015 /** The type of this block. The value is always `paragraph`. */ 016 @JsonDeserialize( 017 using = 018 HubParagraphTextBlockV2025R0TypeField.HubParagraphTextBlockV2025R0TypeFieldDeserializer 019 .class) 020 @JsonSerialize( 021 using = 022 HubParagraphTextBlockV2025R0TypeField.HubParagraphTextBlockV2025R0TypeFieldSerializer 023 .class) 024 protected EnumWrapper<HubParagraphTextBlockV2025R0TypeField> type; 025 026 /** Text content of the block. Includes rich text formatting. */ 027 protected final String fragment; 028 029 public HubParagraphTextBlockV2025R0( 030 @JsonProperty("id") String id, @JsonProperty("fragment") String fragment) { 031 super(id); 032 this.fragment = fragment; 033 this.type = 034 new EnumWrapper<HubParagraphTextBlockV2025R0TypeField>( 035 HubParagraphTextBlockV2025R0TypeField.PARAGRAPH); 036 } 037 038 protected HubParagraphTextBlockV2025R0(Builder builder) { 039 super(builder); 040 this.type = builder.type; 041 this.fragment = builder.fragment; 042 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 043 } 044 045 public EnumWrapper<HubParagraphTextBlockV2025R0TypeField> getType() { 046 return type; 047 } 048 049 public String getFragment() { 050 return fragment; 051 } 052 053 @Override 054 public boolean equals(Object o) { 055 if (this == o) { 056 return true; 057 } 058 if (o == null || getClass() != o.getClass()) { 059 return false; 060 } 061 HubParagraphTextBlockV2025R0 casted = (HubParagraphTextBlockV2025R0) o; 062 return Objects.equals(id, casted.id) 063 && Objects.equals(parentId, casted.parentId) 064 && Objects.equals(type, casted.type) 065 && Objects.equals(fragment, casted.fragment); 066 } 067 068 @Override 069 public int hashCode() { 070 return Objects.hash(id, parentId, type, fragment); 071 } 072 073 @Override 074 public String toString() { 075 return "HubParagraphTextBlockV2025R0{" 076 + "id='" 077 + id 078 + '\'' 079 + ", " 080 + "parentId='" 081 + parentId 082 + '\'' 083 + ", " 084 + "type='" 085 + type 086 + '\'' 087 + ", " 088 + "fragment='" 089 + fragment 090 + '\'' 091 + "}"; 092 } 093 094 public static class Builder extends HubDocumentBlockV2025R0.Builder { 095 096 protected EnumWrapper<HubParagraphTextBlockV2025R0TypeField> type; 097 098 protected final String fragment; 099 100 public Builder(String id, String fragment) { 101 super(id); 102 this.fragment = fragment; 103 } 104 105 public Builder type(HubParagraphTextBlockV2025R0TypeField type) { 106 this.type = new EnumWrapper<HubParagraphTextBlockV2025R0TypeField>(type); 107 return this; 108 } 109 110 public Builder type(EnumWrapper<HubParagraphTextBlockV2025R0TypeField> type) { 111 this.type = type; 112 return this; 113 } 114 115 @Override 116 public Builder parentId(String parentId) { 117 this.parentId = parentId; 118 this.markNullableFieldAsSet("parent_id"); 119 return this; 120 } 121 122 public HubParagraphTextBlockV2025R0 build() { 123 if (this.type == null) { 124 this.type = 125 new EnumWrapper<HubParagraphTextBlockV2025R0TypeField>( 126 HubParagraphTextBlockV2025R0TypeField.PARAGRAPH); 127 } 128 return new HubParagraphTextBlockV2025R0(this); 129 } 130 } 131}