001package com.box.sdkgen.schemas.v2025r0.hubdocumentblockv2025r0;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import java.util.Objects;
009
010/** Base block in the Box Hub Document. */
011@JsonFilter("nullablePropertyFilter")
012public class HubDocumentBlockV2025R0 extends SerializableObject {
013
014  /** The unique identifier for this block. */
015  protected final String id;
016
017  /** The unique identifier of the parent block. Null for direct children of the page. */
018  @JsonProperty("parent_id")
019  @Nullable
020  protected String parentId;
021
022  public HubDocumentBlockV2025R0(@JsonProperty("id") String id) {
023    super();
024    this.id = id;
025  }
026
027  protected HubDocumentBlockV2025R0(Builder builder) {
028    super();
029    this.id = builder.id;
030    this.parentId = builder.parentId;
031    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
032  }
033
034  public String getId() {
035    return id;
036  }
037
038  public String getParentId() {
039    return parentId;
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    HubDocumentBlockV2025R0 casted = (HubDocumentBlockV2025R0) o;
051    return Objects.equals(id, casted.id) && Objects.equals(parentId, casted.parentId);
052  }
053
054  @Override
055  public int hashCode() {
056    return Objects.hash(id, parentId);
057  }
058
059  @Override
060  public String toString() {
061    return "HubDocumentBlockV2025R0{"
062        + "id='"
063        + id
064        + '\''
065        + ", "
066        + "parentId='"
067        + parentId
068        + '\''
069        + "}";
070  }
071
072  public static class Builder extends NullableFieldTracker {
073
074    protected final String id;
075
076    protected String parentId;
077
078    public Builder(String id) {
079      super();
080      this.id = id;
081    }
082
083    public Builder parentId(String parentId) {
084      this.parentId = parentId;
085      this.markNullableFieldAsSet("parent_id");
086      return this;
087    }
088
089    public HubDocumentBlockV2025R0 build() {
090      return new HubDocumentBlockV2025R0(this);
091    }
092  }
093}