2 * Copyright (C) The Arvados Authors. All rights reserved.
4 * SPDX-License-Identifier: AGPL-3.0 OR Apache-2.0
8 package org.arvados.client.api.model.argument;
10 import com.fasterxml.jackson.annotation.JsonFormat;
11 import com.fasterxml.jackson.annotation.JsonInclude;
12 import com.fasterxml.jackson.annotation.JsonProperty;
13 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
15 @JsonFormat(shape = JsonFormat.Shape.ARRAY)
16 @JsonInclude(JsonInclude.Include.NON_NULL)
17 @JsonPropertyOrder({ "attribute", "operator", "operand" })
20 @JsonProperty("attribute")
21 private String attribute;
23 @JsonProperty("operator")
24 private Operator operator;
26 @JsonProperty("operand")
27 private Object operand;
29 private Filter(String attribute, Operator operator, Object operand) {
30 this.attribute = attribute;
31 this.operator = operator;
32 this.operand = operand;
35 public static Filter of(String attribute, Operator operator, Object operand) {
36 return new Filter(attribute, operator, operand);
39 public String getAttribute() {
40 return this.attribute;
43 public Operator getOperator() {
47 public Object getOperand() {
51 public boolean equals(Object o) {
52 if (o == this) return true;
53 if (!(o instanceof Filter)) return false;
54 final Filter other = (Filter) o;
55 final Object this$attribute = this.getAttribute();
56 final Object other$attribute = other.getAttribute();
57 if (this$attribute == null ? other$attribute != null : !this$attribute.equals(other$attribute)) return false;
58 final Object this$operator = this.getOperator();
59 final Object other$operator = other.getOperator();
60 if (this$operator == null ? other$operator != null : !this$operator.equals(other$operator)) return false;
61 final Object this$operand = this.getOperand();
62 final Object other$operand = other.getOperand();
63 if (this$operand == null ? other$operand != null : !this$operand.equals(other$operand)) return false;
67 public int hashCode() {
70 final Object $attribute = this.getAttribute();
71 result = result * PRIME + ($attribute == null ? 43 : $attribute.hashCode());
72 final Object $operator = this.getOperator();
73 result = result * PRIME + ($operator == null ? 43 : $operator.hashCode());
74 final Object $operand = this.getOperand();
75 result = result * PRIME + ($operand == null ? 43 : $operand.hashCode());
79 public String toString() {
80 return "Filter(attribute=" + this.getAttribute() + ", operator=" + this.getOperator() + ", operand=" + this.getOperand() + ")";
83 public enum Operator {
100 @JsonProperty("ilike")
112 @JsonProperty("not in")
115 @JsonProperty("is_a")
118 @JsonProperty("exists")