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

Graph #83

Merged
merged 2 commits into from
Aug 14, 2019
Merged

Graph #83

merged 2 commits into from
Aug 14, 2019

Conversation

Felipe444
Copy link
Collaborator

No description provided.


Set<ServiceContracts> serviceContractsSet = environmentRepository.get(env).getAllServices().stream()
.map(service ->
serviceContractsRepository.find(service.getName(), service.getVersion()).orElseGet(

Choose a reason for hiding this comment

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

i would extract it to private method

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

.map(service ->
serviceContractsRepository.find(service.getName(), service.getVersion()).orElseGet(
() -> new ServiceContracts(service.getName(), service.getVersion(), new HashMap<>(), new HashMap<>())))
.collect(Collectors.toSet());

Choose a reason for hiding this comment

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

maybe add another .map here to build dtos so below you will be able to write just return new InterrelationshipDto(env, serviceContractsSet);

private final ServiceContractsRepository serviceContractsRepository;
private final ContractsMapper contractsMapper;

@Autowired

Choose a reason for hiding this comment

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

use lombok?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was not used throughout the project in this case, we should introduce it globally

@Felipe444 Felipe444 merged commit b6d26a8 into master Aug 14, 2019
@Felipe444 Felipe444 deleted the graph branch August 14, 2019 11:01
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.

3 participants