001package com.box.sdkgen.schemas.tasks; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.box.sdkgen.schemas.task.Task; 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 tasks. */ 012@JsonFilter("nullablePropertyFilter") 013public class Tasks 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 @JsonProperty("total_count") 020 protected Long totalCount; 021 022 /** A list of tasks. */ 023 protected List<Task> entries; 024 025 public Tasks() { 026 super(); 027 } 028 029 protected Tasks(Builder builder) { 030 super(); 031 this.totalCount = builder.totalCount; 032 this.entries = builder.entries; 033 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 034 } 035 036 public Long getTotalCount() { 037 return totalCount; 038 } 039 040 public List<Task> getEntries() { 041 return entries; 042 } 043 044 @Override 045 public boolean equals(Object o) { 046 if (this == o) { 047 return true; 048 } 049 if (o == null || getClass() != o.getClass()) { 050 return false; 051 } 052 Tasks casted = (Tasks) o; 053 return Objects.equals(totalCount, casted.totalCount) && Objects.equals(entries, casted.entries); 054 } 055 056 @Override 057 public int hashCode() { 058 return Objects.hash(totalCount, entries); 059 } 060 061 @Override 062 public String toString() { 063 return "Tasks{" 064 + "totalCount='" 065 + totalCount 066 + '\'' 067 + ", " 068 + "entries='" 069 + entries 070 + '\'' 071 + "}"; 072 } 073 074 public static class Builder extends NullableFieldTracker { 075 076 protected Long totalCount; 077 078 protected List<Task> entries; 079 080 public Builder totalCount(Long totalCount) { 081 this.totalCount = totalCount; 082 return this; 083 } 084 085 public Builder entries(List<Task> entries) { 086 this.entries = entries; 087 return this; 088 } 089 090 public Tasks build() { 091 return new Tasks(this); 092 } 093 } 094}