001package com.box.sdkgen.schemas.v2026r0.queryresultentryv2026r0; 002 003import com.box.sdkgen.internal.NullableFieldTracker; 004import com.box.sdkgen.internal.SerializableObject; 005import com.fasterxml.jackson.annotation.JsonAnyGetter; 006import com.fasterxml.jackson.annotation.JsonAnySetter; 007import com.fasterxml.jackson.annotation.JsonFilter; 008import com.fasterxml.jackson.annotation.JsonProperty; 009import java.util.Map; 010import java.util.Objects; 011 012/** 013 * A single item matching the query. Always includes the item `type` and `id`. If a `fields` 014 * parameter was specified in the request, then additional item and/or metadata fields will be 015 * provided. 016 */ 017@JsonFilter("nullablePropertyFilter") 018public class QueryResultEntryV2026R0 extends SerializableObject { 019 020 /** The unique identifier of the matching item. */ 021 protected final String id; 022 023 /** The type of the matching item. */ 024 protected final String type; 025 026 @JsonAnyGetter @JsonAnySetter protected Map<String, Object> extraData; 027 028 public QueryResultEntryV2026R0(@JsonProperty("id") String id, @JsonProperty("type") String type) { 029 super(); 030 this.id = id; 031 this.type = type; 032 } 033 034 protected QueryResultEntryV2026R0(Builder builder) { 035 super(); 036 this.id = builder.id; 037 this.type = builder.type; 038 this.extraData = builder.extraData; 039 markNullableFieldsAsSet(builder.getExplicitlySetNullableFields()); 040 } 041 042 public String getId() { 043 return id; 044 } 045 046 public String getType() { 047 return type; 048 } 049 050 public Map<String, Object> getExtraData() { 051 return extraData; 052 } 053 054 @Override 055 public boolean equals(Object o) { 056 if (this == o) { 057 return true; 058 } 059 if (o == null || getClass() != o.getClass()) { 060 return false; 061 } 062 QueryResultEntryV2026R0 casted = (QueryResultEntryV2026R0) o; 063 return Objects.equals(id, casted.id) 064 && Objects.equals(type, casted.type) 065 && Objects.equals(extraData, casted.extraData); 066 } 067 068 @Override 069 public int hashCode() { 070 return Objects.hash(id, type, extraData); 071 } 072 073 @Override 074 public String toString() { 075 return "QueryResultEntryV2026R0{" 076 + "id='" 077 + id 078 + '\'' 079 + ", " 080 + "type='" 081 + type 082 + '\'' 083 + ", " 084 + "extraData='" 085 + extraData 086 + '\'' 087 + "}"; 088 } 089 090 public static class Builder extends NullableFieldTracker { 091 092 protected final String id; 093 094 protected final String type; 095 096 protected Map<String, Object> extraData; 097 098 public Builder(String id, String type) { 099 super(); 100 this.id = id; 101 this.type = type; 102 } 103 104 public Builder extraData(Map<String, Object> extraData) { 105 this.extraData = extraData; 106 return this; 107 } 108 109 public QueryResultEntryV2026R0 build() { 110 return new QueryResultEntryV2026R0(this); 111 } 112 } 113}