-
-
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.
support for custom predicate for mixed lines
- Loading branch information
Showing
7 changed files
with
140 additions
and
25 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
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,14 @@ | ||
import name.velikodniy.vitaliy.fixedlength.Align; | ||
import name.velikodniy.vitaliy.fixedlength.annotation.FixedField; | ||
import name.velikodniy.vitaliy.fixedlength.annotation.FixedLine; | ||
|
||
@FixedLine(predicate = EmployeePositionPredicate.class) | ||
public class EmployeePosition { | ||
|
||
@FixedField(offset = 1, length = 10, align = Align.LEFT) | ||
private String position; | ||
|
||
public String getPosition() { | ||
return position; | ||
} | ||
} |
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,9 @@ | ||
import java.util.function.Predicate; | ||
|
||
public class EmployeePositionPredicate implements Predicate<String> { | ||
|
||
@Override | ||
public boolean test(String s) { | ||
return s.contains("POSITION"); | ||
} | ||
} |
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,12 @@ | ||
import name.velikodniy.vitaliy.fixedlength.Align; | ||
import name.velikodniy.vitaliy.fixedlength.annotation.FixedField; | ||
import name.velikodniy.vitaliy.fixedlength.annotation.FixedLine; | ||
|
||
@FixedLine | ||
public class EmployeeWithEmptyAnnotation implements Row { | ||
@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