-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#731 - refactoring: convert CsvColumnSettings to record
- Loading branch information
1 parent
32f9078
commit 14e39ff
Showing
2 changed files
with
5 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 2 additions & 85 deletions
87
...r/src/main/java/de/deadlocker8/budgetmaster/transactions/csvimport/CsvColumnSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,6 @@ | ||
package de.deadlocker8.budgetmaster.transactions.csvimport; | ||
|
||
import java.util.Objects; | ||
|
||
public final class CsvColumnSettings | ||
public record CsvColumnSettings(int columnDate, String datePattern, int columnName, int columnAmount, | ||
String decimalSeparator, String groupingSeparator, int columnDescription) | ||
{ | ||
private final int columnDate; | ||
private final String datePattern; | ||
private final int columnName; | ||
private final int columnAmount; | ||
private final String decimalSeparator; | ||
private final String groupingSeparator; | ||
private final int columnDescription; | ||
|
||
public CsvColumnSettings(int columnDate, String datePattern, int columnName, int columnAmount, String decimalSeparator, String groupingSeparator, int columnDescription) | ||
{ | ||
this.columnDate = columnDate; | ||
this.datePattern = datePattern; | ||
this.columnName = columnName; | ||
this.columnAmount = columnAmount; | ||
this.decimalSeparator = decimalSeparator; | ||
this.groupingSeparator = groupingSeparator; | ||
this.columnDescription = columnDescription; | ||
} | ||
|
||
public int columnDate() | ||
{ | ||
return columnDate; | ||
} | ||
|
||
public String getDatePattern() | ||
{ | ||
return datePattern; | ||
} | ||
|
||
public int columnName() | ||
{ | ||
return columnName; | ||
} | ||
|
||
public int columnAmount() | ||
{ | ||
return columnAmount; | ||
} | ||
|
||
public String getDecimalSeparator() | ||
{ | ||
return decimalSeparator; | ||
} | ||
|
||
public String getGroupingSeparator() | ||
{ | ||
return groupingSeparator; | ||
} | ||
|
||
public int columnDescription() | ||
{ | ||
return columnDescription; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) | ||
{ | ||
if(this == o) return true; | ||
if(o == null || getClass() != o.getClass()) return false; | ||
CsvColumnSettings that = (CsvColumnSettings) o; | ||
return columnDate == that.columnDate && columnName == that.columnName && columnAmount == that.columnAmount && columnDescription == that.columnDescription && Objects.equals(datePattern, that.datePattern) && Objects.equals(decimalSeparator, that.decimalSeparator) && Objects.equals(groupingSeparator, that.groupingSeparator); | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
return Objects.hash(columnDate, datePattern, columnName, columnAmount, decimalSeparator, groupingSeparator, columnDescription); | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return "CsvColumnSettings{" + | ||
"columnDate=" + columnDate + | ||
", datePattern='" + datePattern + '\'' + | ||
", columnName=" + columnName + | ||
", columnAmount=" + columnAmount + | ||
", decimalSeparator='" + decimalSeparator + '\'' + | ||
", groupingSeparator='" + groupingSeparator + '\'' + | ||
", columnDescription=" + columnDescription + | ||
'}'; | ||
} | ||
} |