Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for sorting the EN16931 genericode lists by Code alphabetically #2

Merged
merged 2 commits into from
May 7, 2024

Conversation

svanteschubert
Copy link
Contributor

Just a drill no real PR and asking for assistance (or reporting a potential issue)
Trying out ph-genericode by extending its example for sorting the EN16931 genericode lists alphabetically by their Code

@svanteschubert svanteschubert marked this pull request as draft May 7, 2024 19:17
@svanteschubert
Copy link
Contributor Author

Why is an Object returned? How can the attribute value of @ColumnRef be accessed?

Object lhsColumnRef = lhs.getValue().get(0).getColumnRef();
see https://github.com/svanteschubert/ph-genericode/blob/gc-example/src/test/java/com/helger/genericode/Genericode10EN16931CodeListMarshallerTest.java#L86

I aim to get full access to all data of the EN16931 genericode lists to be able to do regression tests and automatic testing!

Copy link
Owner

@phax phax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave some proposals

@svanteschubert
Copy link
Contributor Author

Thanks for all the help, the access to the data and the sort are working now!
I am no longer overwriting the initial files (that was just for quick turnaround testing using Visual Studio Code to see changes) and writing them to target/generated-test-sources but you might change this at will (no feelings).
As well, you may switch to lambdas and use the ph libs, while I try to stick with the natives to be able to copy and paste the trick easily.

Thanks again, at least the EN16931 GC reading was successful...I will likely start with POI tomorrow for the spreadsheet. not the expected 1-2 hours but likely more the 1-2 days ;-)

@svanteschubert
Copy link
Contributor Author

PS: If there are any Nullpointer - like no Code in an EU e-invoice code list, I would like to let them throw... ;-)
Again for a defensive example, you might add preventions, but I am happy with what I got.. Good night! :-)

@svanteschubert svanteschubert marked this pull request as ready for review May 7, 2024 21:44
@phax phax merged commit 5d6475d into phax:master May 7, 2024
3 checks passed
phax added a commit that referenced this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants