001package com.box.sdkgen.schemas.v2026r0.queryorderbyv2026r0; 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 * A single sorting criterion applied to the query result set. Multiple criteria are applied 013 * sequentially in the order specified. 014 */ 015@JsonFilter("nullablePropertyFilter") 016public class QueryOrderByV2026R0 extends SerializableObject { 017 018 /** The fully qualified field key to sort by. */ 019 @JsonProperty("field_key") 020 protected final String fieldKey; 021 022 /** The direction in which results are ordered. */ 023 @JsonDeserialize( 024 using = QueryOrderByV2026R0DirectionField.QueryOrderByV2026R0DirectionFieldDeserializer.class) 025 @JsonSerialize( 026 using = QueryOrderByV2026R0DirectionField.QueryOrderByV2026R0DirectionFieldSerializer.class) 027 protected final EnumWrapper<QueryOrderByV2026R0DirectionField> direction; 028 029 public QueryOrderByV2026R0(String fieldKey, QueryOrderByV2026R0DirectionField direction) { 030 super(); 031 this.fieldKey = fieldKey; 032 this.direction = new EnumWrapper<QueryOrderByV2026R0DirectionField>(direction); 033 } 034 035 public QueryOrderByV2026R0( 036 @JsonProperty("field_key") String fieldKey, 037 @JsonProperty("direction") EnumWrapper<QueryOrderByV2026R0DirectionField> direction) { 038 super(); 039 this.fieldKey = fieldKey; 040 this.direction = direction; 041 } 042 043 public String getFieldKey() { 044 return fieldKey; 045 } 046 047 public EnumWrapper<QueryOrderByV2026R0DirectionField> getDirection() { 048 return direction; 049 } 050 051 @Override 052 public boolean equals(Object o) { 053 if (this == o) { 054 return true; 055 } 056 if (o == null || getClass() != o.getClass()) { 057 return false; 058 } 059 QueryOrderByV2026R0 casted = (QueryOrderByV2026R0) o; 060 return Objects.equals(fieldKey, casted.fieldKey) && Objects.equals(direction, casted.direction); 061 } 062 063 @Override 064 public int hashCode() { 065 return Objects.hash(fieldKey, direction); 066 } 067 068 @Override 069 public String toString() { 070 return "QueryOrderByV2026R0{" 071 + "fieldKey='" 072 + fieldKey 073 + '\'' 074 + ", " 075 + "direction='" 076 + direction 077 + '\'' 078 + "}"; 079 } 080}