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