-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaked the library to support inheritance
- Updated FixedLength.java - Updated ParserTest.java - Updated FormatterTest.java - Created InheritedEmployee.java - Created AbstractPerson.java
- Loading branch information
Oliver Stewart
committed
Apr 29, 2024
1 parent
881e63a
commit 86e2e65
Showing
5 changed files
with
72 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import name.velikodniy.vitaliy.fixedlength.Align; | ||
import name.velikodniy.vitaliy.fixedlength.annotation.FixedField; | ||
|
||
public abstract class AbstractPerson { | ||
@FixedField(offset = 1, length = 10, align = Align.LEFT) | ||
public String firstName; | ||
|
||
@FixedField(offset = 11, length = 10, align = Align.LEFT) | ||
String lastName; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import name.velikodniy.vitaliy.fixedlength.Align; | ||
import name.velikodniy.vitaliy.fixedlength.annotation.FixedField; | ||
|
||
import java.math.BigDecimal; | ||
import java.time.LocalDate; | ||
|
||
public class InheritedEmployee extends AbstractPerson implements Row { | ||
|
||
@FixedField(offset = 21, length = 10, align = Align.LEFT) | ||
protected String title; | ||
|
||
@FixedField(offset = 31, length = 6, padding = '0') | ||
private BigDecimal salary; | ||
|
||
@FixedField(offset = 37, length = 8, format = "MMddyyyy") | ||
public LocalDate hireDate; | ||
|
||
} |
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