-
Notifications
You must be signed in to change notification settings - Fork 5
/
list_predicate.go
67 lines (57 loc) · 1.52 KB
/
list_predicate.go
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
package cypher
type ListPredicate struct {
ExpressionContainer
variable SymbolicName
listExpression Expression
where Where
key string
notNil bool
err error
}
func ListPredicateCreate(variable SymbolicName, listExpression Expression, where Where) ListPredicate {
if variable.GetError() != nil {
return ListPredicateError(variable.GetError())
}
if listExpression != nil && listExpression.GetError() != nil {
return ListPredicateError(variable.GetError())
}
if where.GetError() != nil {
return ListPredicateError(variable.GetError())
}
listPredicate := ListPredicate{
variable: variable,
listExpression: listExpression,
where: where,
notNil: true,
}
listPredicate.key = getAddress(&listPredicate)
listPredicate.ExpressionContainer = ExpressionWrap(listPredicate)
return listPredicate
}
func ListPredicateError(err error) ListPredicate {
return ListPredicate{err: err}
}
func (l ListPredicate) GetError() error {
return l.err
}
func (l ListPredicate) accept(visitor *CypherRenderer) {
visitor.enter(l)
l.variable.accept(visitor)
IN.accept(visitor)
l.listExpression.accept(visitor)
l.where.accept(visitor)
visitor.leave(l)
}
func (l ListPredicate) enter(renderer *CypherRenderer) {
}
func (l ListPredicate) leave(renderer *CypherRenderer) {
}
func (l ListPredicate) getKey() string {
return l.key
}
func (l ListPredicate) isNotNil() bool {
return l.notNil
}
func (l ListPredicate) GetExpressionType() ExpressionType {
return "ListPredicate"
}