source: josm/trunk/src/org/openstreetmap/josm/gui/progress/ProgressTaskId.java@ 14206

Last change on this file since 14206 was 12369, checked in by michael2402, 7 years ago

Javadoc for gui.progress package

  • Property svn:eol-style set to native
File size: 996 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.progress;
3
4import java.util.Objects;
5
6/**
7 * The ID of a progress task. It is required to run tasks in background
8 */
9public class ProgressTaskId {
10
11 private final String id;
12
13 /**
14 * Create a new {@link ProgressTaskId}
15 * @param component The JOSM component name that creates this id
16 * @param task The task name
17 */
18 public ProgressTaskId(String component, String task) {
19 this.id = component + '.' + task;
20 }
21
22 /**
23 * Gets the id
24 * @return The task id
25 */
26 public String getId() {
27 return id;
28 }
29
30 @Override
31 public int hashCode() {
32 return Objects.hash(id);
33 }
34
35 @Override
36 public boolean equals(Object obj) {
37 if (this == obj) return true;
38 if (obj == null || getClass() != obj.getClass()) return false;
39 ProgressTaskId that = (ProgressTaskId) obj;
40 return Objects.equals(id, that.id);
41 }
42}
Note: See TracBrowser for help on using the repository browser.