public static TheHashinator constructHashinator ( Class < ? extends TheHashinator > hashinatorImplementation , byte configBytes [ ] , boolean cooked ) { try { Constructor < ? extends TheHashinator > constructor = hashinatorImplementation . getConstructor ( byte [ ] . class , boolean . class ) ; return constructor . newInstance ( configBytes , cooked ) ; } catch ( Exception e ) { Throwables . propagate ( e ) ; } return null ; }
Helper method to do the reflection boilerplate to call the constructor of the selected hashinator and convert the exceptions to runtime exceptions .