Last active
April 8, 2018 23:32
-
-
Save dblevins/d8f36dd35e99a90a5d994de609dcde48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert annotations on each method's params | |
clazz.getMethods().stream() | |
.map(CallableDeclaration::getParameters) | |
.flatMap(Collection::stream) | |
.map(Parameter::getAnnotations) | |
.flatMap(Collection::stream) | |
.forEach(converter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert annotations on each method's params | |
clazz.getMethods().stream() | |
.flatMap(method -> method.getParameters().stream()) | |
.flatMap(parameter -> parameter.getAnnotations().stream()) | |
.forEach(converter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assumes Stream has a method signature similar to: | |
// default <R> Stream<R> flatMap(Collection<? extends R> collection) { | |
// return collection.stream(); | |
// } | |
// Convert annotations on each method's params | |
clazz.getMethods().stream() | |
.flatMap(CallableDeclaration::getParameters) | |
.flatMap(Parameter::getAnnotations) | |
.forEach(converter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment