Skip to main content
summaryrefslogtreecommitdiffstats
blob: 7fbc817900e7be637f33a831a6f932b95e6f09b7 (plain) (blame)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*******************************************************************************
 * Copyright (c) 2012 Tasktop Technologies and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Tasktop Technologies - initial API and implementation
 *     Endre Zoltan Kovacs - adding {@link TaskData} to the API.
 *******************************************************************************/

package org.eclipse.mylyn.tasks.core;

import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.mylyn.tasks.core.data.TaskData;

/**
 * @author Sam Davis
 * @since 3.7
 */
public class TaskJobEvent {

	private final ITask task;

	private final ITask originalTask;

	private final TaskData taskData;

	public TaskJobEvent(ITask originalTask, ITask task) {
		this(originalTask, task, null);
	}

	/**
	 * @since 3.11
	 */
	public TaskJobEvent(final ITask originalTask, final ITask task, @Nullable final TaskData taskData) {
		this.originalTask = originalTask;
		this.task = task;
		this.taskData = taskData;
	}

	/**
	 * @return the original task that was submitted
	 */
	public ITask getOriginalTask() {
		return originalTask;
	}

	/**
	 * @return the task that exists after submission has completed; will be the same as originalTask unless originalTask
	 *         was a new (previously unsubmitted) task and this is a submission complete event
	 */
	public ITask getTask() {
		return task;
	}

	/**
	 * @return The taskData of the task being submitted. On 'aboutTosubmit', it holds the unsubmitted taskData, on
	 *         'taskSubmitted' it is the updated taskData. May be <code>null</code>.
	 * @since 3.11
	 */
	public TaskData getTaskData() {
		return taskData;
	}

}

Back to the top