001package com.box.sdkgen.schemas.storagepolicyassignments;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.schemas.storagepolicyassignment.StoragePolicyAssignment;
007import com.fasterxml.jackson.annotation.JsonFilter;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import java.util.List;
010import java.util.Objects;
011
012/** A list of storage policy assignments. */
013@JsonFilter("nullablePropertyFilter")
014public class StoragePolicyAssignments extends SerializableObject {
015
016  /**
017   * The limit that was used for these entries. This will be the same as the `limit` query parameter
018   * unless that value exceeded the maximum value allowed. The maximum value varies by API.
019   */
020  protected Long limit;
021
022  /** The marker for the start of the next page of results. */
023  @JsonProperty("next_marker")
024  @Nullable
025  protected String nextMarker;
026
027  /** The marker for the start of the previous page of results. */
028  @JsonProperty("prev_marker")
029  @Nullable
030  protected String prevMarker;
031
032  /** A list of storage policy assignments. */
033  protected List<StoragePolicyAssignment> entries;
034
035  public StoragePolicyAssignments() {
036    super();
037  }
038
039  protected StoragePolicyAssignments(Builder builder) {
040    super();
041    this.limit = builder.limit;
042    this.nextMarker = builder.nextMarker;
043    this.prevMarker = builder.prevMarker;
044    this.entries = builder.entries;
045    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
046  }
047
048  public Long getLimit() {
049    return limit;
050  }
051
052  public String getNextMarker() {
053    return nextMarker;
054  }
055
056  public String getPrevMarker() {
057    return prevMarker;
058  }
059
060  public List<StoragePolicyAssignment> getEntries() {
061    return entries;
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    StoragePolicyAssignments casted = (StoragePolicyAssignments) o;
073    return Objects.equals(limit, casted.limit)
074        && Objects.equals(nextMarker, casted.nextMarker)
075        && Objects.equals(prevMarker, casted.prevMarker)
076        && Objects.equals(entries, casted.entries);
077  }
078
079  @Override
080  public int hashCode() {
081    return Objects.hash(limit, nextMarker, prevMarker, entries);
082  }
083
084  @Override
085  public String toString() {
086    return "StoragePolicyAssignments{"
087        + "limit='"
088        + limit
089        + '\''
090        + ", "
091        + "nextMarker='"
092        + nextMarker
093        + '\''
094        + ", "
095        + "prevMarker='"
096        + prevMarker
097        + '\''
098        + ", "
099        + "entries='"
100        + entries
101        + '\''
102        + "}";
103  }
104
105  public static class Builder extends NullableFieldTracker {
106
107    protected Long limit;
108
109    protected String nextMarker;
110
111    protected String prevMarker;
112
113    protected List<StoragePolicyAssignment> entries;
114
115    public Builder limit(Long limit) {
116      this.limit = limit;
117      return this;
118    }
119
120    public Builder nextMarker(String nextMarker) {
121      this.nextMarker = nextMarker;
122      this.markNullableFieldAsSet("next_marker");
123      return this;
124    }
125
126    public Builder prevMarker(String prevMarker) {
127      this.prevMarker = prevMarker;
128      this.markNullableFieldAsSet("prev_marker");
129      return this;
130    }
131
132    public Builder entries(List<StoragePolicyAssignment> entries) {
133      this.entries = entries;
134      return this;
135    }
136
137    public StoragePolicyAssignments build() {
138      return new StoragePolicyAssignments(this);
139    }
140  }
141}