1 /*
2 * Copyright (C) 2010, Google Inc. and others
3 *
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Distribution License v. 1.0 which is available at
6 * https://www.eclipse.org/org/documents/edl-v10.php.
7 *
8 * SPDX-License-Identifier: BSD-3-Clause
9 */
10
11 package org.eclipse.jgit.events;
12
13 /**
14 * Describes a change to one or more paths in the index file.
15 */
16 public class IndexChangedEvent extends RepositoryEvent<IndexChangedListener> {
17 private boolean internal;
18
19 /**
20 * Notify that the index changed
21 *
22 * @param internal
23 * {@code true} if the index was changed by the same
24 * JGit process
25 * @since 5.0
26 */
27 public IndexChangedEvent(boolean internal) {
28 this.internal = internal;
29 }
30
31 /**
32 * @return {@code true} if the index was changed by the same JGit process
33 * @since 5.0
34 */
35 public boolean isInternal() {
36 return internal;
37 }
38
39 /** {@inheritDoc} */
40 @Override
41 public Class<IndexChangedListener> getListenerType() {
42 return IndexChangedListener.class;
43 }
44
45 /** {@inheritDoc} */
46 @Override
47 public void dispatch(IndexChangedListener listener) {
48 listener.onIndexChanged(this);
49 }
50 }