com.flybotix.hfr.util.lang.MethodCaller Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of highfrequencyrobots Show documentation
Show all versions of highfrequencyrobots Show documentation
A way for wifi robots and IoT devices to quickly send compressed data arrays across a network.
package com.flybotix.hfr.util.lang;
import java.lang.reflect.InvocationTargetException;
public class MethodCaller {
public static > Boolean getBooleanFromEnum(Class pClass, String pMethod, Boolean pDefault) {
E inst = EnumUtils.getFirstEnumInstance(pClass);
Boolean result = null;
try {
result = Boolean.valueOf(pClass.getMethod(pMethod).invoke(inst).toString());
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
| NoSuchMethodException | SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return NullSafe.replaceNull(result, pDefault);
}
}