1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.events;
11
12 import java.util.Collection;
13 import java.util.Collections;
14
15 import org.eclipse.jgit.annotations.NonNull;
16
17
18
19
20
21
22
23
24
25 public class WorkingTreeModifiedEvent
26 extends RepositoryEvent<WorkingTreeModifiedListener> {
27
28 private Collection<String> modified;
29
30 private Collection<String> deleted;
31
32
33
34
35
36
37
38
39
40
41 public WorkingTreeModifiedEvent(Collection<String> modified,
42 Collection<String> deleted) {
43 this.modified = modified;
44 this.deleted = deleted;
45 }
46
47
48
49
50
51
52
53 public boolean isEmpty() {
54 return (modified == null || modified.isEmpty())
55 && (deleted == null || deleted.isEmpty());
56 }
57
58
59
60
61
62
63
64 @NonNull
65 public Collection<String> getModified() {
66 Collection<String> result = modified;
67 if (result == null) {
68 result = Collections.emptyList();
69 modified = result;
70 }
71 return result;
72 }
73
74
75
76
77
78
79
80 @NonNull
81 public Collection<String> getDeleted() {
82 Collection<String> result = deleted;
83 if (result == null) {
84 result = Collections.emptyList();
85 deleted = result;
86 }
87 return result;
88 }
89
90
91 @Override
92 public Class<WorkingTreeModifiedListener> getListenerType() {
93 return WorkingTreeModifiedListener.class;
94 }
95
96
97 @Override
98 public void dispatch(WorkingTreeModifiedListener listener) {
99 listener.onWorkingTreeModified(this);
100 }
101 }