- java.lang.Object
-
- org.eclipse.jgit.events.RepositoryEvent<WorkingTreeModifiedListener>
-
- org.eclipse.jgit.events.WorkingTreeModifiedEvent
-
public class WorkingTreeModifiedEvent extends RepositoryEvent<WorkingTreeModifiedListener>
ARepositoryEventdescribing changes to the working tree. It is fired whenever aDirCacheCheckoutmodifies (adds/deletes/updates) files in the working tree.- Since:
- 4.9
-
-
Constructor Summary
Constructors Constructor Description WorkingTreeModifiedEvent(Collection<String> modified, Collection<String> deleted)Creates a newWorkingTreeModifiedEventwith the given collections.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispatch(WorkingTreeModifiedListener listener)Dispatch this event to the given listener.Collection<String>getDeleted()Retrieves theCollectionof repository-relative paths of files that were deleted.Class<WorkingTreeModifiedListener>getListenerType()Get type of listener this event dispatches toCollection<String>getModified()Retrieves theCollectionof repository-relative paths of files that were modified (added or updated).booleanisEmpty()Determines whether there are any changes recorded in this event.-
Methods inherited from class org.eclipse.jgit.events.RepositoryEvent
getRepository, setRepository, toString
-
-
-
-
Constructor Detail
-
WorkingTreeModifiedEvent
public WorkingTreeModifiedEvent(Collection<String> modified, Collection<String> deleted)
Creates a newWorkingTreeModifiedEventwith the given collections.- Parameters:
modified- repository-relative paths that were added or updateddeleted- repository-relative paths that were deleted
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Determines whether there are any changes recorded in this event.- Returns:
trueif no files were modified or deleted,falseotherwise
-
getModified
@NonNull public Collection<String> getModified()
Retrieves theCollectionof repository-relative paths of files that were modified (added or updated).- Returns:
- the set
-
getDeleted
@NonNull public Collection<String> getDeleted()
Retrieves theCollectionof repository-relative paths of files that were deleted.- Returns:
- the set
-
getListenerType
public Class<WorkingTreeModifiedListener> getListenerType()
Get type of listener this event dispatches to- Specified by:
getListenerTypein classRepositoryEvent<WorkingTreeModifiedListener>- Returns:
- type of listener this event dispatches to
-
dispatch
public void dispatch(WorkingTreeModifiedListener listener)
Dispatch this event to the given listener.- Specified by:
dispatchin classRepositoryEvent<WorkingTreeModifiedListener>- Parameters:
listener- listener that wants this event.
-
-