forked from manhcuongbk56/cypher-go-dsl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
properties.go
55 lines (43 loc) · 1018 Bytes
/
properties.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
package cypher
type Properties struct {
properties MapExpression
key string
notNil bool
err error
}
func PropertiesCreate(newProperties MapExpression) Properties {
if newProperties.GetError() != nil {
return PropertiesError(newProperties.GetError())
}
p := Properties{properties: newProperties, notNil: true}
p.key = getAddress(&p)
return p
}
func PropertiesError(err error) Properties {
return Properties{
err: err,
}
}
func (p Properties) isNotNil() bool {
return p.notNil
}
func (p Properties) getKey() string {
return p.key
}
func (p Properties) GetError() error {
return p.err
}
func (p Properties) accept(visitor *CypherRenderer) {
visitor.enter(p)
p.properties.accept(visitor)
visitor.leave(p)
}
func (p Properties) AddProperties(entries []Expression) Properties {
p.properties = p.properties.AddEntries(entries)
return p
}
func (p Properties) enter(renderer *CypherRenderer) {
renderer.append(" ")
}
func (p Properties) leave(renderer *CypherRenderer) {
}