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

Add UndirectedGraph.vertexExists(node) method + NodeBreakerView.getOptionalTerminal(node) #1235

Merged
merged 2 commits into from
Mar 24, 2020

Conversation

miovd
Copy link
Contributor

@miovd miovd commented Mar 19, 2020

Signed-off-by: RALAMBOTIANA MIORA miora.ralambotiana@rte-france.com

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem ?
No

What kind of change does this PR introduce?
Feature

What is the current behavior?
If a node in NodeBreakerView does not have an attached network component, the methode getTerminal(node) throws an exception.

What is the new behavior (if this is a feature change)?
The method getOptionalTerminal now exists and can return an empty Optional if there is no attached network component to a valid node.

Does this PR introduce a breaking change or deprecate an API?
No

Other information:

Linked to #1233

@miovd
Copy link
Contributor Author

miovd commented Mar 20, 2020

@mathbagu Not sure if this is a good idea to do this, but at the very least, what do you think about a getOptionalTerminal() that will not return an exception?

@miovd miovd requested a review from mathbagu March 20, 2020 14:57
@miovd miovd changed the title [WIP] Add UndirectedGraph.vertexExists() method + change NodeBreakerView.getTerminal(node) behaviour Add UndirectedGraph.vertexExists() method + change NodeBreakerView.getTerminal(node) behaviour Mar 20, 2020
@miovd miovd changed the title Add UndirectedGraph.vertexExists() method + change NodeBreakerView.getTerminal(node) behaviour [WIP] Add UndirectedGraph.vertexExists() method + NodeBreakerView.getOptionalTerminal(node) Mar 24, 2020
…tTerminal(node) behaviour

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>

revert getTerminal and create getOptionalTerminal

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>

revert

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>

correction

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>

correct test

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>

add test

Signed-off-by: RALAMBOTIANA MIORA <miora.ralambotiana@rte-france.com>
@miovd miovd changed the title [WIP] Add UndirectedGraph.vertexExists() method + NodeBreakerView.getOptionalTerminal(node) [WIP] Add UndirectedGraph.vertexExists(node) method + NodeBreakerView.getOptionalTerminal(node) Mar 24, 2020
@miovd miovd changed the title [WIP] Add UndirectedGraph.vertexExists(node) method + NodeBreakerView.getOptionalTerminal(node) Add UndirectedGraph.vertexExists(node) method + NodeBreakerView.getOptionalTerminal(node) Mar 24, 2020
@miovd miovd requested a review from mathbagu March 24, 2020 12:01
@sonarcloud
Copy link

sonarcloud bot commented Mar 24, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

81.2% 81.2% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants