Last active
May 11, 2016 21:31
-
-
Save leonardosnt/3d2ef8f3e94b50b5206ab3529f4d8014 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
float f = Methods.from(this).find("xisde").invoke(); | |
//Normal | |
java.lang.reflect.Method md = getClass().getDeclaredMethod("xisde"); | |
md.setAccessible(true); | |
float x = (float) md.invoke(this); | |
int f = Methods | |
.from(this) | |
.find("xisde") // return java.lang.Float | |
.invokeAsMethods() | |
.find("intValue") | |
.invoke(); | |
Methods | |
.from(this) | |
.find("xisde") // return java.lang.Float | |
.then(m -> { | |
System.out.println(Modifier.toString(m.getModifiers())); | |
m.setModifiers((m.getModifiers() & ~Modifier.PRIVATE) | Modifier.PUBLIC); | |
System.out.println(Modifier.toString(m.getModifiers())); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment