-
Notifications
You must be signed in to change notification settings - Fork 5
/
EmAssetInputEntityData.java
70 lines (61 loc) · 2.13 KB
/
EmAssetInputEntityData.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
/*
* © 2023. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.io.factory.input;
import edu.ie3.datamodel.models.UniqueEntity;
import edu.ie3.datamodel.models.input.EmInput;
import edu.ie3.datamodel.models.input.OperatorInput;
import java.util.Map;
import java.util.Objects;
/**
* Data used for the construction of {@link edu.ie3.datamodel.models.input.AssetInput} entities
* which also require an EM attribute. This data object can include additional information about the
* {@link EmInput}, which cannot be provided through the attribute map as it is a complex shared
* entity.
*/
public class EmAssetInputEntityData extends AssetInputEntityData {
private final EmInput emUnit;
public EmAssetInputEntityData(
Map<String, String> fieldsToAttributes,
Class<? extends UniqueEntity> entityClass,
EmInput emUnit) {
super(fieldsToAttributes, entityClass);
this.emUnit = emUnit;
}
public EmAssetInputEntityData(
Map<String, String> fieldsToAttributes,
Class<? extends UniqueEntity> entityClass,
OperatorInput operator,
EmInput emUnit) {
super(fieldsToAttributes, entityClass, operator);
this.emUnit = emUnit;
}
/**
* Creates a new EmAssetInputEntityData object based on a given {@link AssetInputEntityData}
* object and given em unit
*
* @param entityData The entity data object to use attributes of
* @param emUnit The em input to use
*/
public EmAssetInputEntityData(AssetInputEntityData entityData, EmInput emUnit) {
super(entityData, entityData.getOperatorInput());
this.emUnit = emUnit;
}
public EmInput getEmUnit() {
return emUnit;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
EmAssetInputEntityData that = (EmAssetInputEntityData) o;
return Objects.equals(emUnit, that.emUnit);
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), emUnit);
}
}