Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Serializer updates #20

Merged
merged 3 commits into from
Aug 18, 2016
Merged

Serializer updates #20

merged 3 commits into from
Aug 18, 2016

Conversation

markopi
Copy link
Contributor

@markopi markopi commented Aug 12, 2016

Fixed some issues that were encountered when converting adl designer to use archie parser/serializer/flattener.

Adl parser will fail if there is no empty line between definition and terminology sections
@codecov-io
Copy link

Current coverage is 64.72% (diff: 52.94%)

Merging #20 into master will decrease coverage by 0.01%

@@             master        #20   diff @@
==========================================
  Files           308        308          
  Lines          6489       6500    +11   
  Methods           0          0          
  Messages          0          0          
  Branches        977        979     +2   
==========================================
+ Hits           4201       4207     +6   
- Misses         1919       1922     +3   
- Partials        369        371     +2   

Powered by Codecov. Last update afb6f4e...0ae68bb

ArchetypeTerm term = cobj.getArchetype().getTerm(cobj, cobj.getArchetype().getOriginalLanguage().getCodeString());
String originalLanguage = ofNullable(cobj)
.flatMap(c -> ofNullable(c.getArchetype()))
.flatMap(a -> ofNullable(a.getOriginalLanguage()))
Copy link
Member

Choose a reason for hiding this comment

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

You can just use .map instead of flatmap and custom wrapping the result in an Optional:

    String originalLanguage = ofNullable(cobj)
        .map(CObject::getArchetype)
        .map(Archetype::getOriginalLanguage)
        .map(TerminologyCode::getCodeString)
        .orElse(null);

Apart from that, it looks good 👍

@steijgeler steijgeler merged commit 7880415 into nedap:master Aug 18, 2016
pieterbos added a commit that referenced this pull request Mar 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants