-
Notifications
You must be signed in to change notification settings - Fork 5
/
NodeAssetInputEntityData.java
84 lines (76 loc) · 2.66 KB
/
NodeAssetInputEntityData.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
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* © 2021. 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.NodeInput;
import edu.ie3.datamodel.models.input.OperatorInput;
import java.util.Objects;
/**
* Data used by all factories used to create instances of {@link
* edu.ie3.datamodel.models.input.InputEntity}s holding one {@link NodeInput} entity, thus needing
* additional information about the {@link edu.ie3.datamodel.models.input.NodeInput}, which cannot
* be provided through the attribute map.
*/
public class NodeAssetInputEntityData extends AssetInputEntityData {
private final NodeInput node;
/**
* Creates a new UntypedSingleNodeEntityData object for an operated, always on system participant
* input
*
* @param mapWithRowIndex object containing an attribute map: field name to value and a row index
* @param entityClass class of the entity to be created with this data
* @param node input node
*/
public NodeAssetInputEntityData(
MapWithRowIndex mapWithRowIndex, Class<? extends UniqueEntity> entityClass, NodeInput node) {
super(mapWithRowIndex, entityClass);
this.node = node;
}
/**
* Creates a new UntypedSingleNodeEntityData object for an operable system participant input
*
* @param mapWithRowIndex object containing an attribute map: field name to value and a row index
* @param entityClass class of the entity to be created with this data
* @param node input node
* @param operator operator input
*/
public NodeAssetInputEntityData(
MapWithRowIndex mapWithRowIndex,
Class<? extends UniqueEntity> entityClass,
OperatorInput operator,
NodeInput node) {
super(mapWithRowIndex, entityClass, operator);
this.node = node;
}
public NodeInput getNode() {
return node;
}
@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;
NodeAssetInputEntityData that = (NodeAssetInputEntityData) o;
return getNode().equals(that.getNode());
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), getNode());
}
@Override
public String toString() {
return "NodeAssetInputEntityData{"
+ "fieldsToValues="
+ getFieldsToValues()
+ ", targetClass="
+ getTargetClass()
+ ", operatorInput="
+ getOperatorInput().getUuid()
+ ", node="
+ node.getUuid()
+ '}';
}
}