-
Notifications
You must be signed in to change notification settings - Fork 5
/
NodeGraphicInputEntityData.java
62 lines (54 loc) · 1.83 KB
/
NodeGraphicInputEntityData.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
/*
* © 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.graphics;
import edu.ie3.datamodel.io.factory.EntityData;
import edu.ie3.datamodel.models.input.NodeInput;
import edu.ie3.datamodel.models.input.graphics.NodeGraphicInput;
import java.util.Objects;
/**
* Data used by {@link NodeGraphicInputFactory} used to create instances of {@link
* edu.ie3.datamodel.models.input.graphics.NodeGraphicInput}s holding one {@link NodeInput} entity.
*/
public class NodeGraphicInputEntityData extends EntityData {
/** The NodeInput to this graphic data */
private final NodeInput node;
/**
* Creates a new NodeGraphicInputentityData object for an a NodeGraphicInput
*
* @param mapWithRowIndex object containing an attribute map: field name to value and a row index
* @param node node input element of this graphic
*/
public NodeGraphicInputEntityData(MapWithRowIndex mapWithRowIndex, NodeInput node) {
super(mapWithRowIndex, NodeGraphicInput.class);
this.node = node;
}
public NodeInput getNode() {
return node;
}
@Override
public String toString() {
return "NodeGraphicInputEntityData{"
+ "node="
+ node.getUuid()
+ ", fieldsToValues="
+ getFieldsToValues()
+ ", targetClass="
+ getTargetClass()
+ '}';
}
@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;
NodeGraphicInputEntityData that = (NodeGraphicInputEntityData) o;
return getNode().equals(that.getNode());
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), getNode());
}
}