-
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.
#724 - added input to enter custom date parse pattern
- Loading branch information
1 parent
9fc90b8
commit 1aecff3
Showing
5 changed files
with
91 additions
and
6 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
75 changes: 74 additions & 1 deletion
75
...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,5 +1,78 @@ | ||
package de.deadlocker8.budgetmaster.transactions.csvimport; | ||
|
||
public record CsvColumnSettings(int columnDate, int columnName, int columnAmount, int columnDescription) | ||
import java.util.Objects; | ||
|
||
public final class CsvColumnSettings | ||
{ | ||
private final int columnDate; | ||
private String datePattern; | ||
private final int columnName; | ||
private final int columnAmount; | ||
private final int columnDescription; | ||
|
||
public CsvColumnSettings(int columnDate, String datePattern, int columnName, int columnAmount, int columnDescription) | ||
{ | ||
this.columnDate = columnDate; | ||
this.datePattern = datePattern; | ||
this.columnName = columnName; | ||
this.columnAmount = columnAmount; | ||
this.columnDescription = columnDescription; | ||
} | ||
|
||
public int columnDate() | ||
{ | ||
return columnDate; | ||
} | ||
|
||
public String getDatePattern() | ||
{ | ||
return datePattern; | ||
} | ||
|
||
public void setDatePattern(String datePattern) | ||
{ | ||
this.datePattern = datePattern; | ||
} | ||
|
||
public int columnName() | ||
{ | ||
return columnName; | ||
} | ||
|
||
public int columnAmount() | ||
{ | ||
return columnAmount; | ||
} | ||
|
||
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); | ||
} | ||
|
||
@Override | ||
public int hashCode() | ||
{ | ||
return Objects.hash(columnDate, datePattern, columnName, columnAmount, columnDescription); | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return "CsvColumnSettings{" + | ||
"columnDate=" + columnDate + | ||
", datePattern='" + datePattern + '\'' + | ||
", columnName=" + columnName + | ||
", columnAmount=" + columnAmount + | ||
", columnDescription=" + columnDescription + | ||
'}'; | ||
} | ||
} |
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
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
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