322 } |
322 } |
323 try { |
323 try { |
324 final Constructor<T> ctor = clazz.getConstructor(String.class); |
324 final Constructor<T> ctor = clazz.getConstructor(String.class); |
325 return Optional.of(ctor.newInstance(paramValue)); |
325 return Optional.of(ctor.newInstance(paramValue)); |
326 } catch (ReflectiveOperationException e) { |
326 } catch (ReflectiveOperationException e) { |
327 throw new RuntimeException(e); |
327 // does not type check and is not convertible - treat as if the parameter was never set |
|
328 return Optional.empty(); |
328 } |
329 } |
329 } |
330 } |
330 } |
331 } |
331 |
332 |
332 /** |
333 /** |