001package com.box.sdkgen.schemas.v2025r0.hubdocumentpagev2025r0;
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/** A Page in the Box Hub Document. */
011@JsonFilter("nullablePropertyFilter")
012public class HubDocumentPageV2025R0 extends SerializableObject {
013
014  /** The unique identifier for this page. */
015  protected final String id;
016
017  /** The type of this resource. The value is always `page`. */
018  protected final String type;
019
020  /** The unique identifier of the parent page. Null for root-level pages. */
021  @JsonProperty("parent_id")
022  @Nullable
023  protected String parentId;
024
025  /** The title text of the page. Includes rich text formatting. */
026  @JsonProperty("title_fragment")
027  protected final String titleFragment;
028
029  public HubDocumentPageV2025R0(
030      @JsonProperty("id") String id,
031      @JsonProperty("type") String type,
032      @JsonProperty("title_fragment") String titleFragment) {
033    super();
034    this.id = id;
035    this.type = type;
036    this.titleFragment = titleFragment;
037  }
038
039  protected HubDocumentPageV2025R0(Builder builder) {
040    super();
041    this.id = builder.id;
042    this.type = builder.type;
043    this.parentId = builder.parentId;
044    this.titleFragment = builder.titleFragment;
045    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
046  }
047
048  public String getId() {
049    return id;
050  }
051
052  public String getType() {
053    return type;
054  }
055
056  public String getParentId() {
057    return parentId;
058  }
059
060  public String getTitleFragment() {
061    return titleFragment;
062  }
063
064  @Override
065  public boolean equals(Object o) {
066    if (this == o) {
067      return true;
068    }
069    if (o == null || getClass() != o.getClass()) {
070      return false;
071    }
072    HubDocumentPageV2025R0 casted = (HubDocumentPageV2025R0) o;
073    return Objects.equals(id, casted.id)
074        && Objects.equals(type, casted.type)
075        && Objects.equals(parentId, casted.parentId)
076        && Objects.equals(titleFragment, casted.titleFragment);
077  }
078
079  @Override
080  public int hashCode() {
081    return Objects.hash(id, type, parentId, titleFragment);
082  }
083
084  @Override
085  public String toString() {
086    return "HubDocumentPageV2025R0{"
087        + "id='"
088        + id
089        + '\''
090        + ", "
091        + "type='"
092        + type
093        + '\''
094        + ", "
095        + "parentId='"
096        + parentId
097        + '\''
098        + ", "
099        + "titleFragment='"
100        + titleFragment
101        + '\''
102        + "}";
103  }
104
105  public static class Builder extends NullableFieldTracker {
106
107    protected final String id;
108
109    protected final String type;
110
111    protected String parentId;
112
113    protected final String titleFragment;
114
115    public Builder(String id, String type, String titleFragment) {
116      super();
117      this.id = id;
118      this.type = type;
119      this.titleFragment = titleFragment;
120    }
121
122    public Builder parentId(String parentId) {
123      this.parentId = parentId;
124      this.markNullableFieldAsSet("parent_id");
125      return this;
126    }
127
128    public HubDocumentPageV2025R0 build() {
129      return new HubDocumentPageV2025R0(this);
130    }
131  }
132}