Skip to content

Commit dbb8d6d

Browse files
chore: add medical technology id value object
1 parent 1cf60ab commit dbb8d6d

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package entity.medicaltechnology;
10+
11+
import java.util.Objects;
12+
13+
/**
14+
* Identification of a {@link MedicalTechnology}.
15+
*/
16+
public class MedicalTechnologyID {
17+
private final String id;
18+
19+
/**
20+
* Default constructor.
21+
* @param id the id
22+
*/
23+
public MedicalTechnologyID(final String id) {
24+
this.id = id;
25+
}
26+
27+
/**
28+
* Get the id.
29+
* @return the id
30+
*/
31+
public String getId() {
32+
return this.id;
33+
}
34+
35+
@Override
36+
public final boolean equals(final Object other) {
37+
if (this == other) {
38+
return true;
39+
}
40+
if (other == null || this.getClass() != other.getClass()) {
41+
return false;
42+
}
43+
final MedicalTechnologyID that = (MedicalTechnologyID) other;
44+
return this.getId().equals(that.getId());
45+
}
46+
47+
@Override
48+
public final int hashCode() {
49+
return Objects.hash(this.getId());
50+
}
51+
}

0 commit comments

Comments
 (0)