001package com.box.sdkgen.schemas.collaborationsoffsetpaginated;
002
003import com.box.sdkgen.internal.NullableFieldTracker;
004import com.box.sdkgen.internal.SerializableObject;
005import com.box.sdkgen.schemas.collaboration.Collaboration;
006import com.fasterxml.jackson.annotation.JsonFilter;
007import com.fasterxml.jackson.annotation.JsonProperty;
008import java.util.List;
009import java.util.Objects;
010
011/** A list of collaborations. */
012@JsonFilter("nullablePropertyFilter")
013public class CollaborationsOffsetPaginated extends SerializableObject {
014
015  /**
016   * One greater than the offset of the last entry in the entire collection. The total number of
017   * entries in the collection may be less than `total_count`.
018   *
019   * <p>This field is only returned for calls that use offset-based pagination. For marker-based
020   * paginated APIs, this field will be omitted.
021   */
022  @JsonProperty("total_count")
023  protected Long totalCount;
024
025  /**
026   * The limit that was used for these entries. This will be the same as the `limit` query parameter
027   * unless that value exceeded the maximum value allowed. The maximum value varies by API.
028   */
029  protected Long limit;
030
031  /**
032   * The 0-based offset of the first entry in this set. This will be the same as the `offset` query
033   * parameter.
034   *
035   * <p>This field is only returned for calls that use offset-based pagination. For marker-based
036   * paginated APIs, this field will be omitted.
037   */
038  protected Long offset;
039
040  /** A list of collaborations. */
041  protected List<Collaboration> entries;
042
043  public CollaborationsOffsetPaginated() {
044    super();
045  }
046
047  protected CollaborationsOffsetPaginated(Builder builder) {
048    super();
049    this.totalCount = builder.totalCount;
050    this.limit = builder.limit;
051    this.offset = builder.offset;
052    this.entries = builder.entries;
053    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
054  }
055
056  public Long getTotalCount() {
057    return totalCount;
058  }
059
060  public Long getLimit() {
061    return limit;
062  }
063
064  public Long getOffset() {
065    return offset;
066  }
067
068  public List<Collaboration> getEntries() {
069    return entries;
070  }
071
072  @Override
073  public boolean equals(Object o) {
074    if (this == o) {
075      return true;
076    }
077    if (o == null || getClass() != o.getClass()) {
078      return false;
079    }
080    CollaborationsOffsetPaginated casted = (CollaborationsOffsetPaginated) o;
081    return Objects.equals(totalCount, casted.totalCount)
082        && Objects.equals(limit, casted.limit)
083        && Objects.equals(offset, casted.offset)
084        && Objects.equals(entries, casted.entries);
085  }
086
087  @Override
088  public int hashCode() {
089    return Objects.hash(totalCount, limit, offset, entries);
090  }
091
092  @Override
093  public String toString() {
094    return "CollaborationsOffsetPaginated{"
095        + "totalCount='"
096        + totalCount
097        + '\''
098        + ", "
099        + "limit='"
100        + limit
101        + '\''
102        + ", "
103        + "offset='"
104        + offset
105        + '\''
106        + ", "
107        + "entries='"
108        + entries
109        + '\''
110        + "}";
111  }
112
113  public static class Builder extends NullableFieldTracker {
114
115    protected Long totalCount;
116
117    protected Long limit;
118
119    protected Long offset;
120
121    protected List<Collaboration> entries;
122
123    public Builder totalCount(Long totalCount) {
124      this.totalCount = totalCount;
125      return this;
126    }
127
128    public Builder limit(Long limit) {
129      this.limit = limit;
130      return this;
131    }
132
133    public Builder offset(Long offset) {
134      this.offset = offset;
135      return this;
136    }
137
138    public Builder entries(List<Collaboration> entries) {
139      this.entries = entries;
140      return this;
141    }
142
143    public CollaborationsOffsetPaginated build() {
144      return new CollaborationsOffsetPaginated(this);
145    }
146  }
147}