001package com.box.sdkgen.schemas.v2025r0.hubitemlistblockv2025r0; 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/** An item list block in the Box Hub Document. */ 012@JsonFilter("nullablePropertyFilter") 013public class HubItemListBlockV2025R0 extends HubDocumentBlockV2025R0 { 014 015 /** The type of this block. The value is always `item_list`. */ 016 @JsonDeserialize( 017 using = HubItemListBlockV2025R0TypeField.HubItemListBlockV2025R0TypeFieldDeserializer.class) 018 @JsonSerialize( 019 using = HubItemListBlockV2025R0TypeField.HubItemListBlockV2025R0TypeFieldSerializer.class) 020 protected EnumWrapper<HubItemListBlockV2025R0TypeField> type; 021 022 public HubItemListBlockV2025R0(@JsonProperty("id") String id) { 023 super(id); 024 this.type = 025 new EnumWrapper<HubItemListBlockV2025R0TypeField>( 026 HubItemListBlockV2025R0TypeField.ITEM_LIST); 027 } 028 029 protected HubItemListBlockV2025R0(Builder builder) { 030 super(builder); 031 this.type = builder.type; 032 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 033 } 034 035 public EnumWrapper<HubItemListBlockV2025R0TypeField> getType() { 036 return type; 037 } 038 039 @Override 040 public boolean equals(Object o) { 041 if (this == o) { 042 return true; 043 } 044 if (o == null || getClass() != o.getClass()) { 045 return false; 046 } 047 HubItemListBlockV2025R0 casted = (HubItemListBlockV2025R0) o; 048 return Objects.equals(id, casted.id) 049 && Objects.equals(parentId, casted.parentId) 050 && Objects.equals(type, casted.type); 051 } 052 053 @Override 054 public int hashCode() { 055 return Objects.hash(id, parentId, type); 056 } 057 058 @Override 059 public String toString() { 060 return "HubItemListBlockV2025R0{" 061 + "id='" 062 + id 063 + '\'' 064 + ", " 065 + "parentId='" 066 + parentId 067 + '\'' 068 + ", " 069 + "type='" 070 + type 071 + '\'' 072 + "}"; 073 } 074 075 public static class Builder extends HubDocumentBlockV2025R0.Builder { 076 077 protected EnumWrapper<HubItemListBlockV2025R0TypeField> type; 078 079 public Builder(String id) { 080 super(id); 081 } 082 083 public Builder type(HubItemListBlockV2025R0TypeField type) { 084 this.type = new EnumWrapper<HubItemListBlockV2025R0TypeField>(type); 085 return this; 086 } 087 088 public Builder type(EnumWrapper<HubItemListBlockV2025R0TypeField> type) { 089 this.type = type; 090 return this; 091 } 092 093 @Override 094 public Builder parentId(String parentId) { 095 this.parentId = parentId; 096 this.markNullableFieldAsSet("parent_id"); 097 return this; 098 } 099 100 public HubItemListBlockV2025R0 build() { 101 if (this.type == null) { 102 this.type = 103 new EnumWrapper<HubItemListBlockV2025R0TypeField>( 104 HubItemListBlockV2025R0TypeField.ITEM_LIST); 105 } 106 return new HubItemListBlockV2025R0(this); 107 } 108 } 109}