Skip to content

Commit

Permalink
Some minor stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ckittl committed Jan 6, 2022
1 parent 825c034 commit a862eb5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import edu.ie3.datamodel.models.input.system.type.HpTypeInput;
import edu.ie3.datamodel.models.input.thermal.ThermalBusInput;
import java.util.Map;
import java.util.Objects;

public class HpInputEntityData extends SystemParticipantTypedEntityData<HpTypeInput> {
private final ThermalBusInput thermalBusInput;
Expand Down Expand Up @@ -38,6 +39,19 @@ public ThermalBusInput getThermalBusInput() {
return thermalBusInput;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof HpInputEntityData that)) return false;
if (!super.equals(o)) return false;
return thermalBusInput.equals(that.thermalBusInput);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), thermalBusInput);
}

@Override
public String toString() {
return "HpInputEntityData{"
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/edu/ie3/datamodel/io/source/csv/CsvDataSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public abstract class CsvDataSource {
* @deprecated ensures downward compatibility with old csv data format. Can be removed when
* support for old csv format is removed. *
*/
@Deprecated private boolean notYetLoggedWarning = true;
@Deprecated(since = "1.1.0", forRemoval = true)
private boolean notYetLoggedWarning = true;

protected CsvDataSource(String csvSep, String folderPath, FileNamingStrategy fileNamingStrategy) {
this.csvSep = csvSep;
Expand Down Expand Up @@ -169,7 +170,7 @@ protected String[] parseCsvRow(String csvRow, String csvSep) {
* @return an array with one entry per column of the provided csv row string
* @deprecated only left for downward compatibility. Will be removed in a major release
*/
@Deprecated
@Deprecated(since = "1.1.0", forRemoval = true)
private String[] oldFieldVals(String csvSep, String csvRow) {

/*geo json support*/
Expand All @@ -181,8 +182,8 @@ private String[] oldFieldVals(String csvSep, String csvRow) {
final String charReplacement = "charRepl";

/*removes double double quotes*/
List<String> geoList = extractMatchingStrings(geoJsonRegex, csvRow.replaceAll("\"\"", "\""));
List<String> charList = extractMatchingStrings(charInputRegex, csvRow.replaceAll("\"\"", "\""));
List<String> geoList = extractMatchingStrings(geoJsonRegex, csvRow.replace("\"\"", "\""));
List<String> charList = extractMatchingStrings(charInputRegex, csvRow.replace("\"\"", "\""));

AtomicInteger geoCounter = new AtomicInteger(0);
AtomicInteger charCounter = new AtomicInteger(0);
Expand Down Expand Up @@ -460,8 +461,10 @@ protected Set<Map<String, String>> distinctRowsWithLog(
String affectedCoordinateIds =
allRowsSet.stream().map(keyExtractor).collect(Collectors.joining(",\n"));
log.error(
"'{}' entities with duplicated {} key, but different field values found! Please review the "
+ "corresponding input file!\nAffected primary keys:\n{}",
"""
'{}' entities with duplicated {} key, but different field values found! Please review the corresponding input file!
Affected primary keys:
{}""",
entityDescriptor,
keyDescriptor,
affectedCoordinateIds);
Expand Down

0 comments on commit a862eb5

Please sign in to comment.