Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java62
1 files changed, 61 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java
index 4aaa0d54c..0272c4571 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TaskHyperlink.java
@@ -38,7 +38,7 @@ public final class TaskHyperlink implements IHyperlink {
private final String taskId;
- Object selection;
+ private Object selection;
public TaskHyperlink(IRegion region, TaskRepository repository, String taskId) {
this.region = region;
@@ -114,4 +114,64 @@ public final class TaskHyperlink implements IHyperlink {
this.selection = selection;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((region == null) ? 0 : region.hashCode());
+ result = prime * result + ((repository == null) ? 0 : repository.hashCode());
+ result = prime * result + ((selection == null) ? 0 : selection.hashCode());
+ result = prime * result + ((taskId == null) ? 0 : taskId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ TaskHyperlink other = (TaskHyperlink) obj;
+ if (region == null) {
+ if (other.region != null) {
+ return false;
+ }
+ } else if (!region.equals(other.region)) {
+ return false;
+ }
+ if (repository == null) {
+ if (other.repository != null) {
+ return false;
+ }
+ } else if (!repository.equals(other.repository)) {
+ return false;
+ }
+ if (selection == null) {
+ if (other.selection != null) {
+ return false;
+ }
+ } else if (!selection.equals(other.selection)) {
+ return false;
+ }
+ if (taskId == null) {
+ if (other.taskId != null) {
+ return false;
+ }
+ } else if (!taskId.equals(other.taskId)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "TaskHyperlink [region=" + region + ", repository=" + repository + ", selection=" + selection //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + ", taskId=" + taskId + "]"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
}

Back to the top