1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.api.domain;
18
19 import com.atlassian.jira.rest.client.api.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
33 private final String name;
34 private final String description;
35 private final Direction direction;
36
37 public IssueLinkType(String name, String description, Direction direction) {
38 this.name = name;
39 this.description = description;
40 this.direction = direction;
41 }
42
43 public String getName() {
44 return name;
45 }
46
47 public String getDescription() {
48 return description;
49 }
50
51 public Direction getDirection() {
52 return direction;
53 }
54
55 @Override
56 public String toString() {
57 return Objects.toStringHelper(this).
58 add("name", name).
59 add("description", description).
60 add("direction", direction).
61 toString();
62 }
63
64 @Override
65 public boolean equals(Object obj) {
66 if (obj instanceof IssueLinkType) {
67 IssueLinkType that = (IssueLinkType) obj;
68 return Objects.equal(this.name, that.name)
69 && Objects.equal(this.description, that.description)
70 && Objects.equal(this.direction, that.direction);
71 }
72 return false;
73 }
74
75 @Override
76 public int hashCode() {
77 return Objects.hashCode(name, description, direction);
78 }
79
80 }