From 469ca05dcd51f2e4cf71e11f039602223c3f1ba2 Mon Sep 17 00:00:00 2001 From: Ondrej Zizka Date: Tue, 2 Dec 2014 17:16:42 +0100 Subject: [PATCH] Property setters to return this to allow call chaining return frame.setFoo(...).setBar(...); --- .../frames/annotations/PropertyAnnotationHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/tinkerpop/frames/annotations/PropertyAnnotationHandler.java b/src/main/java/com/tinkerpop/frames/annotations/PropertyAnnotationHandler.java index e6e2d5f..078a9b1 100644 --- a/src/main/java/com/tinkerpop/frames/annotations/PropertyAnnotationHandler.java +++ b/src/main/java/com/tinkerpop/frames/annotations/PropertyAnnotationHandler.java @@ -34,6 +34,9 @@ public Object processElement(final Property annotation, final Method method, fin element.setProperty(annotation.value(), value); } } + // If return type is this class, return this. + if (method.getReturnType().isAssignableFrom(element.getClass())) + return element; return null; } else if (ClassUtilities.isRemoveMethod(method)) { element.removeProperty(annotation.value());