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

Last change on this file since 12114 was 9371, checked in by simon04, 8 years ago

Java 7: use Objects.equals and Objects.hash

  • Property svn:eol-style set to native
File size: 693 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.progress;
3
4import java.util.Objects;
5
6public class ProgressTaskId {
7
8 private final String id;
9
10 public ProgressTaskId(String component, String task) {
11 this.id = component + '.' + task;
12 }
13
14 public String getId() {
15 return id;
16 }
17
18 @Override
19 public int hashCode() {
20 return Objects.hash(id);
21 }
22
23 @Override
24 public boolean equals(Object obj) {
25 if (this == obj) return true;
26 if (obj == null || getClass() != obj.getClass()) return false;
27 ProgressTaskId that = (ProgressTaskId) obj;
28 return Objects.equals(id, that.id);
29 }
30}
Note: See TracBrowser for help on using the repository browser.