001package com.box.sdkgen.schemas.v2026r0.queryinsightsmetricdefinitionv2026r0; 002 003import com.box.sdkgen.internal.SerializableObject; 004import com.box.sdkgen.serialization.json.EnumWrapper; 005import com.fasterxml.jackson.annotation.JsonFilter; 006import com.fasterxml.jackson.annotation.JsonProperty; 007import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 008import com.fasterxml.jackson.databind.annotation.JsonSerialize; 009import java.util.Objects; 010 011/** 012 * Defines a single metric to compute, including the aggregation function and the field it is 013 * applied to. 014 */ 015@JsonFilter("nullablePropertyFilter") 016public class QueryInsightsMetricDefinitionV2026R0 extends SerializableObject { 017 018 /** The aggregation function to apply. */ 019 @JsonDeserialize( 020 using = 021 QueryInsightsMetricDefinitionV2026R0TypeField 022 .QueryInsightsMetricDefinitionV2026R0TypeFieldDeserializer.class) 023 @JsonSerialize( 024 using = 025 QueryInsightsMetricDefinitionV2026R0TypeField 026 .QueryInsightsMetricDefinitionV2026R0TypeFieldSerializer.class) 027 protected final EnumWrapper<QueryInsightsMetricDefinitionV2026R0TypeField> type; 028 029 /** The fully qualified field name on which the metric is computed. */ 030 protected final String field; 031 032 public QueryInsightsMetricDefinitionV2026R0( 033 QueryInsightsMetricDefinitionV2026R0TypeField type, String field) { 034 super(); 035 this.type = new EnumWrapper<QueryInsightsMetricDefinitionV2026R0TypeField>(type); 036 this.field = field; 037 } 038 039 public QueryInsightsMetricDefinitionV2026R0( 040 @JsonProperty("type") EnumWrapper<QueryInsightsMetricDefinitionV2026R0TypeField> type, 041 @JsonProperty("field") String field) { 042 super(); 043 this.type = type; 044 this.field = field; 045 } 046 047 public EnumWrapper<QueryInsightsMetricDefinitionV2026R0TypeField> getType() { 048 return type; 049 } 050 051 public String getField() { 052 return field; 053 } 054 055 @Override 056 public boolean equals(Object o) { 057 if (this == o) { 058 return true; 059 } 060 if (o == null || getClass() != o.getClass()) { 061 return false; 062 } 063 QueryInsightsMetricDefinitionV2026R0 casted = (QueryInsightsMetricDefinitionV2026R0) o; 064 return Objects.equals(type, casted.type) && Objects.equals(field, casted.field); 065 } 066 067 @Override 068 public int hashCode() { 069 return Objects.hash(type, field); 070 } 071 072 @Override 073 public String toString() { 074 return "QueryInsightsMetricDefinitionV2026R0{" 075 + "type='" 076 + type 077 + '\'' 078 + ", " 079 + "field='" 080 + field 081 + '\'' 082 + "}"; 083 } 084}