001package com.box.sdkgen.schemas.items; 002 003import com.box.sdkgen.internal.Nullable; 004import com.box.sdkgen.internal.NullableFieldTracker; 005import com.box.sdkgen.internal.SerializableObject; 006import com.box.sdkgen.schemas.item.Item; 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 files, folders, and web links in their mini representation. */ 013@JsonFilter("nullablePropertyFilter") 014public class Items 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 /** 033 * One greater than the offset of the last entry in the entire collection. The total number of 034 * entries in the collection may be less than `total_count`. 035 * 036 * <p>This field is only returned for calls that use offset-based pagination. For marker-based 037 * paginated APIs, this field will be omitted. 038 */ 039 @JsonProperty("total_count") 040 protected Long totalCount; 041 042 /** 043 * The 0-based offset of the first entry in this set. This will be the same as the `offset` query 044 * parameter. 045 * 046 * <p>This field is only returned for calls that use offset-based pagination. For marker-based 047 * paginated APIs, this field will be omitted. 048 */ 049 protected Long offset; 050 051 /** 052 * The order by which items are returned. 053 * 054 * <p>This field is only returned for calls that use offset-based pagination. For marker-based 055 * paginated APIs, this field will be omitted. 056 */ 057 protected List<ItemsOrderField> order; 058 059 /** The items in this collection. */ 060 protected List<Item> entries; 061 062 public Items() { 063 super(); 064 } 065 066 protected Items(Builder builder) { 067 super(); 068 this.limit = builder.limit; 069 this.nextMarker = builder.nextMarker; 070 this.prevMarker = builder.prevMarker; 071 this.totalCount = builder.totalCount; 072 this.offset = builder.offset; 073 this.order = builder.order; 074 this.entries = builder.entries; 075 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 076 } 077 078 public Long getLimit() { 079 return limit; 080 } 081 082 public String getNextMarker() { 083 return nextMarker; 084 } 085 086 public String getPrevMarker() { 087 return prevMarker; 088 } 089 090 public Long getTotalCount() { 091 return totalCount; 092 } 093 094 public Long getOffset() { 095 return offset; 096 } 097 098 public List<ItemsOrderField> getOrder() { 099 return order; 100 } 101 102 public List<Item> getEntries() { 103 return entries; 104 } 105 106 @Override 107 public boolean equals(Object o) { 108 if (this == o) { 109 return true; 110 } 111 if (o == null || getClass() != o.getClass()) { 112 return false; 113 } 114 Items casted = (Items) o; 115 return Objects.equals(limit, casted.limit) 116 && Objects.equals(nextMarker, casted.nextMarker) 117 && Objects.equals(prevMarker, casted.prevMarker) 118 && Objects.equals(totalCount, casted.totalCount) 119 && Objects.equals(offset, casted.offset) 120 && Objects.equals(order, casted.order) 121 && Objects.equals(entries, casted.entries); 122 } 123 124 @Override 125 public int hashCode() { 126 return Objects.hash(limit, nextMarker, prevMarker, totalCount, offset, order, entries); 127 } 128 129 @Override 130 public String toString() { 131 return "Items{" 132 + "limit='" 133 + limit 134 + '\'' 135 + ", " 136 + "nextMarker='" 137 + nextMarker 138 + '\'' 139 + ", " 140 + "prevMarker='" 141 + prevMarker 142 + '\'' 143 + ", " 144 + "totalCount='" 145 + totalCount 146 + '\'' 147 + ", " 148 + "offset='" 149 + offset 150 + '\'' 151 + ", " 152 + "order='" 153 + order 154 + '\'' 155 + ", " 156 + "entries='" 157 + entries 158 + '\'' 159 + "}"; 160 } 161 162 public static class Builder extends NullableFieldTracker { 163 164 protected Long limit; 165 166 protected String nextMarker; 167 168 protected String prevMarker; 169 170 protected Long totalCount; 171 172 protected Long offset; 173 174 protected List<ItemsOrderField> order; 175 176 protected List<Item> entries; 177 178 public Builder limit(Long limit) { 179 this.limit = limit; 180 return this; 181 } 182 183 public Builder nextMarker(String nextMarker) { 184 this.nextMarker = nextMarker; 185 this.markNullableFieldAsSet("next_marker"); 186 return this; 187 } 188 189 public Builder prevMarker(String prevMarker) { 190 this.prevMarker = prevMarker; 191 this.markNullableFieldAsSet("prev_marker"); 192 return this; 193 } 194 195 public Builder totalCount(Long totalCount) { 196 this.totalCount = totalCount; 197 return this; 198 } 199 200 public Builder offset(Long offset) { 201 this.offset = offset; 202 return this; 203 } 204 205 public Builder order(List<ItemsOrderField> order) { 206 this.order = order; 207 return this; 208 } 209 210 public Builder entries(List<Item> entries) { 211 this.entries = entries; 212 return this; 213 } 214 215 public Items build() { 216 return new Items(this); 217 } 218 } 219}