-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttachments.java
71 lines (57 loc) · 2.11 KB
/
Attachments.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
package net.florianschoppmann.issuetracking.youtrack;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Attachments {
@XmlElement(name = "attachment")
public final List<Attachment> attachments = new ArrayList<>();
@Override
public boolean equals(Object otherObject) {
return this == otherObject
|| (otherObject instanceof Attachments
&& Objects.equals(attachments, ((Attachments) otherObject).attachments));
}
@Override
public int hashCode() {
return Objects.hashCode(attachments);
}
public static class Attachment {
@XmlAttribute
public @Nullable Integer taskNumberInProject;
@XmlAttribute
public @Nullable String authorLogin;
@XmlAttribute
public @Nullable Long created;
@XmlAttribute
public @Nullable String name;
@XmlAttribute
public @Nullable String path;
@XmlAttribute
public @Nullable String link;
@Override
public boolean equals(Object otherObject) {
if (this == otherObject) {
return true;
} else if (otherObject == null || getClass() != otherObject.getClass()) {
return false;
}
Attachment other = (Attachment) otherObject;
return Objects.equals(taskNumberInProject, other.taskNumberInProject)
&& Objects.equals(authorLogin, other.authorLogin)
&& Objects.equals(created, other.created)
&& Objects.equals(name, other.name)
&& Objects.equals(path, other.path)
&& Objects.equals(link, other.link);
}
@Override
public int hashCode() {
return Objects.hash(taskNumberInProject, authorLogin, created, name, path, link);
}
}
}