Skip to content

Commit cf89206

Browse files
chore: create actuator entity
1 parent ae99f40 commit cf89206

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/env/entity/actuator/Actuator.java

+51
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.actuator;
10+
11+
import java.util.Objects;
12+
13+
/**
14+
* Implementation of the actuator entity.
15+
*/
16+
public class Actuator {
17+
private final ActuatorID actuatorID;
18+
19+
/**
20+
* Default constructor.
21+
* @param actuatorID the actuator id.
22+
*/
23+
public Actuator(final ActuatorID actuatorID) {
24+
this.actuatorID = actuatorID;
25+
}
26+
27+
/**
28+
* Get the actuator id.
29+
* @return the actuator id.
30+
*/
31+
public final ActuatorID getId() {
32+
return this.actuatorID;
33+
}
34+
35+
@Override
36+
public final boolean equals(final Object other) {
37+
if (this == other) {
38+
return true;
39+
}
40+
if (other == null || getClass() != other.getClass()) {
41+
return false;
42+
}
43+
final Actuator actuator = (Actuator) other;
44+
return this.getId().equals(actuator.actuatorID);
45+
}
46+
47+
@Override
48+
public final int hashCode() {
49+
return Objects.hash(this.getId());
50+
}
51+
}

0 commit comments

Comments
 (0)