Tweak test script no issue #
[arvados.git] / src / main / java / org / arvados / client / api / model / argument / Filter.java
1 /*
2  * Copyright (C) The Arvados Authors. All rights reserved.
3  *
4  * SPDX-License-Identifier: AGPL-3.0 OR Apache-2.0
5  *
6  */
7
8 package org.arvados.client.api.model.argument;
9
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;
14
15 @JsonFormat(shape = JsonFormat.Shape.ARRAY)
16 @JsonInclude(JsonInclude.Include.NON_NULL)
17 @JsonPropertyOrder({ "attribute", "operator", "operand" })
18 public class Filter {
19
20     @JsonProperty("attribute")
21     private String attribute;
22
23     @JsonProperty("operator")
24     private Operator operator;
25
26     @JsonProperty("operand")
27     private Object operand;
28
29     private Filter(String attribute, Operator operator, Object operand) {
30         this.attribute = attribute;
31         this.operator = operator;
32         this.operand = operand;
33     }
34
35     public static Filter of(String attribute, Operator operator, Object operand) {
36         return new Filter(attribute, operator, operand);
37     }
38
39     public String getAttribute() {
40         return this.attribute;
41     }
42
43     public Operator getOperator() {
44         return this.operator;
45     }
46
47     public Object getOperand() {
48         return this.operand;
49     }
50
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;
64         return true;
65     }
66
67     public int hashCode() {
68         final int PRIME = 59;
69         int result = 1;
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());
76         return result;
77     }
78
79     public String toString() {
80         return "Filter(attribute=" + this.getAttribute() + ", operator=" + this.getOperator() + ", operand=" + this.getOperand() + ")";
81     }
82
83     public enum Operator {
84
85         @JsonProperty("<")
86         LESS,
87
88         @JsonProperty("<=")
89         LESS_EQUALS,
90
91         @JsonProperty(">=")
92         MORE_EQUALS,
93
94         @JsonProperty(">")
95         MORE,
96
97         @JsonProperty("like")
98         LIKE,
99
100         @JsonProperty("ilike")
101         ILIKE,
102
103         @JsonProperty("=")
104         EQUALS,
105
106         @JsonProperty("!=")
107         NOT_EQUALS,
108
109         @JsonProperty("in")
110         IN,
111
112         @JsonProperty("not in")
113         NOT_IN,
114
115         @JsonProperty("is_a")
116         IS_A
117     }
118 }