1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package io.earcam.instrumental.module.jpms;
20
21 import java.io.Serializable;
22 import java.util.Objects;
23 import java.util.Set;
24
25 import javax.annotation.concurrent.Immutable;
26
27
28
29
30
31
32
33 @Immutable
34 public class Require implements Serializable {
35
36 private static final long serialVersionUID = 935948472668991696L;
37 private final String module;
38 private final int access;
39 private final String version;
40
41
42
43
44
45
46
47
48
49
50
51 public Require(String module, int access, String version)
52 {
53 this.module = module;
54 this.access = access;
55 this.version = version;
56 }
57
58
59 @Override
60 public boolean equals(Object other)
61 {
62 return other instanceof Require && equals((Require) other);
63 }
64
65
66
67
68
69
70
71
72
73
74 public boolean equals(Require that)
75 {
76 return that != null
77 && Objects.equals(that.module(), module)
78 && that.access() == access
79 && Objects.equals(that.version(), version);
80 }
81
82
83 @Override
84 public int hashCode()
85 {
86 return Objects.hash(module, access, version);
87 }
88
89
90
91
92
93
94
95
96
97 public String module()
98 {
99 return module;
100 }
101
102
103
104
105
106
107
108
109
110 public int access()
111 {
112 return access;
113 }
114
115
116
117
118
119
120
121
122
123 public Set<RequireModifier> modifiers()
124 {
125 return Access.modifiers(RequireModifier.class, access());
126 }
127
128
129
130
131
132
133
134
135
136 public String version()
137 {
138 return version;
139 }
140 }