-
Notifications
You must be signed in to change notification settings - Fork 352
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
gh-1612 - ExtractWalkVertex and test added #1613
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1613 +/- ##
=============================================
+ Coverage 66.22% 66.22% +<.01%
Complexity 1841 1841
=============================================
Files 768 769 +1
Lines 24871 24877 +6
Branches 3228 3228
=============================================
+ Hits 16470 16476 +6
Misses 7119 7119
Partials 1282 1282
Continue to review full report at Codecov.
|
import uk.gov.gchq.gaffer.data.graph.Walk; | ||
import uk.gov.gchq.koryphe.function.KorypheFunction; | ||
|
||
public class ExtractWalkVertex extends KorypheFunction<Walk, Object> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some Javadoc describing this function please?
if (null == walk) { | ||
throw new IllegalArgumentException("Walk cannot be null"); | ||
} | ||
return Iterables.get(walk.getEntities().get(0), 0).getVertex(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might there be a use case where having this functionality as part of the Walk
class might be useful as well? Would methods like:
walk.getStartVertex()
or
walk.getDestinationVertices()
be useful?
@@ -188,6 +188,16 @@ public boolean isPath() { | |||
return distinct(getVerticesOrdered()); | |||
} | |||
|
|||
@JsonIgnore | |||
public Object getSourceVertex() { | |||
return entities.get(0).getKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some unit tests for these methods please?
No description provided.