From 8fc57ee2d3c92f0cc972ded2ab12fdb728094969 Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Freeman <jeffrey.freeman@syncleus.com> Date: Sat, 23 Sep 2017 14:55:51 -0400 Subject: [PATCH] refactor: changed list and set implementation to reuse toList and toSet. --- .../annotation/AdjacencyMethodHandler.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/syncleus/ferma/framefactories/annotation/AdjacencyMethodHandler.java b/src/main/java/com/syncleus/ferma/framefactories/annotation/AdjacencyMethodHandler.java index 31a5ae0b..c09b34cb 100644 --- a/src/main/java/com/syncleus/ferma/framefactories/annotation/AdjacencyMethodHandler.java +++ b/src/main/java/com/syncleus/ferma/framefactories/annotation/AdjacencyMethodHandler.java @@ -215,7 +215,7 @@ public class AdjacencyMethodHandler implements MethodHandler { final Direction direction = annotation.direction(); final String label = annotation.label(); - return Collections.unmodifiableList(Lists.newArrayList(thiz.traverse(input -> { + return thiz.traverse(input -> { switch (direction) { case IN: return input.in(label); @@ -226,7 +226,7 @@ public class AdjacencyMethodHandler implements MethodHandler { default: throw new IllegalStateException("Direction not recognized."); } - }).frame(VertexFrame.class))); + }).toList(VertexFrame.class); } } @@ -239,7 +239,7 @@ public class AdjacencyMethodHandler implements MethodHandler { final Direction direction = annotation.direction(); final String label = annotation.label(); - return Collections.unmodifiableSet(Sets.newHashSet(thiz.traverse(input -> { + return thiz.traverse(input -> { switch (direction) { case IN: return input.in(label); @@ -250,7 +250,7 @@ public class AdjacencyMethodHandler implements MethodHandler { default: throw new IllegalStateException("Direction not recognized."); } - }).frame(VertexFrame.class))); + }).toSet(VertexFrame.class); } } @@ -289,7 +289,7 @@ public class AdjacencyMethodHandler implements MethodHandler { final String label = annotation.label(); final TypeResolver resolver = thiz.getGraph().getTypeResolver(); - return Collections.unmodifiableList(Lists.newArrayList(thiz.traverse(input -> { + return thiz.traverse(input -> { switch(direction) { case IN: return resolver.hasType(input.in(label), type); @@ -300,7 +300,7 @@ public class AdjacencyMethodHandler implements MethodHandler { default: throw new IllegalStateException("Direction not recognized."); } - }).frame(type))); + }).toList(type); } } @@ -314,7 +314,7 @@ public class AdjacencyMethodHandler implements MethodHandler { final String label = annotation.label(); final TypeResolver resolver = thiz.getGraph().getTypeResolver(); - return Collections.unmodifiableSet(Sets.newHashSet(thiz.traverse(input -> { + return thiz.traverse(input -> { switch(direction) { case IN: return resolver.hasType(input.in(label), type); @@ -325,7 +325,7 @@ public class AdjacencyMethodHandler implements MethodHandler { default: throw new IllegalStateException("Direction not recognized."); } - }).frame(type))); + }).toSet(type); } } -- GitLab