001package com.box.sdkgen.schemas.v2026r0.queryresultsv2026r0;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.schemas.v2026r0.queryresultentryv2026r0.QueryResultEntryV2026R0;
007import com.fasterxml.jackson.annotation.JsonFilter;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import java.util.List;
010import java.util.Objects;
011
012/** A paginated list of items matching the query, using milestone-based marker pagination. */
013@JsonFilter("nullablePropertyFilter")
014public class QueryResultsV2026R0 extends SerializableObject {
015
016  /** The list of items matching the query predicate. */
017  protected final List<QueryResultEntryV2026R0> entries;
018
019  /**
020   * The marker for the start of the next page of results. When `null`, there are no further results
021   * available.
022   */
023  @JsonProperty("next_marker")
024  @Nullable
025  protected String nextMarker;
026
027  /**
028   * The limit that was used for this request. This will be the same as the limit query parameter
029   * unless that value exceeded the maximum value allowed.
030   */
031  protected final int limit;
032
033  public QueryResultsV2026R0(
034      @JsonProperty("entries") List<QueryResultEntryV2026R0> entries,
035      @JsonProperty("limit") int limit) {
036    super();
037    this.entries = entries;
038    this.limit = limit;
039  }
040
041  protected QueryResultsV2026R0(Builder builder) {
042    super();
043    this.entries = builder.entries;
044    this.nextMarker = builder.nextMarker;
045    this.limit = builder.limit;
046    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
047  }
048
049  public List<QueryResultEntryV2026R0> getEntries() {
050    return entries;
051  }
052
053  public String getNextMarker() {
054    return nextMarker;
055  }
056
057  public int getLimit() {
058    return limit;
059  }
060
061  @Override
062  public boolean equals(Object o) {
063    if (this == o) {
064      return true;
065    }
066    if (o == null || getClass() != o.getClass()) {
067      return false;
068    }
069    QueryResultsV2026R0 casted = (QueryResultsV2026R0) o;
070    return Objects.equals(entries, casted.entries)
071        && Objects.equals(nextMarker, casted.nextMarker)
072        && Objects.equals(limit, casted.limit);
073  }
074
075  @Override
076  public int hashCode() {
077    return Objects.hash(entries, nextMarker, limit);
078  }
079
080  @Override
081  public String toString() {
082    return "QueryResultsV2026R0{"
083        + "entries='"
084        + entries
085        + '\''
086        + ", "
087        + "nextMarker='"
088        + nextMarker
089        + '\''
090        + ", "
091        + "limit='"
092        + limit
093        + '\''
094        + "}";
095  }
096
097  public static class Builder extends NullableFieldTracker {
098
099    protected final List<QueryResultEntryV2026R0> entries;
100
101    protected String nextMarker;
102
103    protected final int limit;
104
105    public Builder(List<QueryResultEntryV2026R0> entries, int limit) {
106      super();
107      this.entries = entries;
108      this.limit = limit;
109    }
110
111    public Builder nextMarker(String nextMarker) {
112      this.nextMarker = nextMarker;
113      this.markNullableFieldAsSet("next_marker");
114      return this;
115    }
116
117    public QueryResultsV2026R0 build() {
118      return new QueryResultsV2026R0(this);
119    }
120  }
121}