1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.domain;
18
19 import com.atlassian.jira.rest.client.NamedEntity;
20 import com.google.common.base.Objects;
21
22
23
24
25
26
27 public class IssueLinkType implements NamedEntity {
28 public enum Direction {
29 OUTBOUND,
30 INBOUND
31 }
32 private final String name;
33 private final String description;
34 private final Direction direction;
35
36 public IssueLinkType(String name, String description, Direction direction) {
37 this.name = name;
38 this.description = description;
39 this.direction = direction;
40 }
41
42 public String getName() {
43 return name;
44 }
45
46 public String getDescription() {
47 return description;
48 }
49
50 public Direction getDirection() {
51 return direction;
52 }
53
54 @Override
55 public String toString() {
56 return Objects.toStringHelper(this).
57 add("name", name).
58 add("description", description).
59 add("direction", direction).
60 toString();
61 }
62
63 @Override
64 public boolean equals(Object obj) {
65 if (obj instanceof IssueLinkType) {
66 IssueLinkType that = (IssueLinkType) obj;
67 return Objects.equal(this.name, that.name)
68 && Objects.equal(this.description, that.description)
69 && Objects.equal(this.direction, that.direction);
70 }
71 return false;
72 }
73
74 @Override
75 public int hashCode() {
76 return Objects.hashCode(name, description, direction);
77 }
78
79 }