- import java.lang.reflect.Method;
- import java.lang.reflect.Type;
- class MethodExtension(o: AnyRef) {
- def methods: List[String] = {
- List.fromArray(o.getClass.getDeclaredMethods).map(m => m.getName)
- }
- }
- implicit def methods(o: AnyRef) = new MethodExtension(o)
- println("".methods)