001package com.box.sdkgen.schemas.metadataqueryresults; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.box.sdkgen.schemas.metadataqueryresultitem.MetadataQueryResultItem; 006import com.fasterxml.jackson.annotation.JsonFilter; 007import com.fasterxml.jackson.annotation.JsonProperty; 008import java.util.List; 009import java.util.Objects; 010 011/** A page of files and folders that matched the metadata query. */ 012@JsonFilter("nullablePropertyFilter") 013public class MetadataQueryResults extends SerializableObject { 014 015 /** 016 * The mini representation of the files and folders that match the search terms. 017 * 018 * <p>By default, this endpoint returns only the most basic info about the items. To get 019 * additional fields for each item, including any of the metadata, use the `fields` attribute in 020 * the query. 021 */ 022 protected List<MetadataQueryResultItem> entries; 023 024 /** 025 * The limit that was used for this search. This will be the same as the `limit` query parameter 026 * unless that value exceeded the maximum value allowed. 027 */ 028 protected Long limit; 029 030 /** The marker for the start of the next page of results. */ 031 @JsonProperty("next_marker") 032 protected String nextMarker; 033 034 public MetadataQueryResults() { 035 super(); 036 } 037 038 protected MetadataQueryResults(Builder builder) { 039 super(); 040 this.entries = builder.entries; 041 this.limit = builder.limit; 042 this.nextMarker = builder.nextMarker; 043 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 044 } 045 046 public List<MetadataQueryResultItem> getEntries() { 047 return entries; 048 } 049 050 public Long getLimit() { 051 return limit; 052 } 053 054 public String getNextMarker() { 055 return nextMarker; 056 } 057 058 @Override 059 public boolean equals(Object o) { 060 if (this == o) { 061 return true; 062 } 063 if (o == null || getClass() != o.getClass()) { 064 return false; 065 } 066 MetadataQueryResults casted = (MetadataQueryResults) o; 067 return Objects.equals(entries, casted.entries) 068 && Objects.equals(limit, casted.limit) 069 && Objects.equals(nextMarker, casted.nextMarker); 070 } 071 072 @Override 073 public int hashCode() { 074 return Objects.hash(entries, limit, nextMarker); 075 } 076 077 @Override 078 public String toString() { 079 return "MetadataQueryResults{" 080 + "entries='" 081 + entries 082 + '\'' 083 + ", " 084 + "limit='" 085 + limit 086 + '\'' 087 + ", " 088 + "nextMarker='" 089 + nextMarker 090 + '\'' 091 + "}"; 092 } 093 094 public static class Builder extends NullableFieldTracker { 095 096 protected List<MetadataQueryResultItem> entries; 097 098 protected Long limit; 099 100 protected String nextMarker; 101 102 public Builder entries(List<MetadataQueryResultItem> entries) { 103 this.entries = entries; 104 return this; 105 } 106 107 public Builder limit(Long limit) { 108 this.limit = limit; 109 return this; 110 } 111 112 public Builder nextMarker(String nextMarker) { 113 this.nextMarker = nextMarker; 114 return this; 115 } 116 117 public MetadataQueryResults build() { 118 return new MetadataQueryResults(this); 119 } 120 } 121}