反射获取方法时:object is not an instance of declaring class
情景:service端需要动态获取payload所拥有的属性,所以想到反射获取解决方法:通过反射获取有参方法时,getMethod的参数不仅要有方法名,还要有方法参数类型的class对象,因为java函数有重载,不能通过只一个方法名来确定一个方法。延伸:可以使用modelMapper,省去额自己写反射的过程。