boolean (@NotNull Object host, @NotNull String value, @NotNull MutableAccessor accessor, @NotNull Class<?> valueClass) { Method fromText; try { fromText = valueClass.getMethod("fromText", String.class); } catch (NoSuchMethodException ignored) { return false; } try { fromText.setAccessible(true); } catch (SecurityException ignored) { } try { accessor.set(host, fromText.invoke(null, value)); return true; } catch (IllegalAccessException | InvocationTargetException ignored) { } return false; }