forked from ravendb/ravendb-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
documents_changes.go
47 lines (41 loc) · 1.41 KB
/
documents_changes.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
package ravendb
// ChangeType describes a type of a change in a document
type ChangeType int
const (
// TODO: make those into a string?
DocumentChangeDocumentDeleted ChangeType = iota
DocumentChangeDocumentAdded
DocumentChangeFieldChanged
DocumentChangeNewField
DocumentChangeRemovedField
DocumentChangeArrayValueChanged
DocumentChangeArrayValueAdded
DocumentChangeArrayValueRemoved
DocumentChangeFieldTypeChanged
DocumentChangeEntityTypeChanged
)
// DocumentsChanges describes a change in a document
type DocumentsChanges struct {
FieldOldValue interface{}
FieldNewValue interface{}
FieldOldType interface{}
FieldNewType interface{}
Change ChangeType
FieldName string
}
/*
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DocumentsChanges that = (DocumentsChanges) o;
if (fieldOldValue != null ? !fieldOldValue.equals(that.fieldOldValue) : that.fieldOldValue != null)
return false;
if (fieldNewValue != null ? !fieldNewValue.equals(that.fieldNewValue) : that.fieldNewValue != null)
return false;
if (fieldOldType != that.fieldOldType) return false;
if (fieldNewType != that.fieldNewType) return false;
if (change != that.change) return false;
return fieldName != null ? fieldName.equals(that.fieldName) : that.fieldName == null;
}
*/