-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCriterion.java
More file actions
70 lines (53 loc) · 1.81 KB
/
Criterion.java
File metadata and controls
70 lines (53 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.apiflows.model;
import com.apiflows.parser.util.CriterionTypeDeserializer;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
public class Criterion {
private String condition;
private String context;
@JsonDeserialize(using = CriterionTypeDeserializer.class)
private Object type;
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
/** Returns the simple string type (e.g. "simple", "regex") or null if an expression type object is used. */
@JsonProperty("type")
public String getType() {
return type instanceof String ? (String) type : null;
}
public void setType(String type) {
this.type = type;
}
/** Returns the expression type object when type is "jsonpath" or "xpath" with a version, or null otherwise. */
public CriterionExpressionType getExpressionType() {
return type instanceof CriterionExpressionType ? (CriterionExpressionType) type : null;
}
public void setExpressionType(CriterionExpressionType expressionType) {
this.type = expressionType;
}
public Criterion condition(String condition) {
this.condition = condition;
return this;
}
public Criterion context(String context) {
this.context = context;
return this;
}
public Criterion type(String type) {
this.type = type;
return this;
}
public Criterion expressionType(CriterionExpressionType expressionType) {
this.type = expressionType;
return this;
}
}