All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.flybotix.hfr.util.lang.MethodCaller Maven / Gradle / Ivy

Go to download

A way for wifi robots and IoT devices to quickly send compressed data arrays across a network.

There is a newer version: 2019.1.11
Show newest version
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);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy