void (@NotNull Object host, @Nullable String value, @NotNull MutableAccessor accessor, @NotNull Class<?> valueClass) { if (value == null) { accessor.set(host, null); } else if (valueClass == String.class) { accessor.set(host, value); } else if (valueClass == int.class) { accessor.setInt(host, Integer.parseInt(value)); } else if (valueClass == boolean.class) { accessor.setBoolean(host, Boolean.parseBoolean(value)); } else if (valueClass == double.class) { accessor.setDouble(host, Double.parseDouble(value)); } else if (valueClass == float.class) { accessor.setFloat(host, Float.parseFloat(value)); } else if (valueClass == long.class) { accessor.setLong(host, Long.parseLong(value)); } else if (valueClass == short.class) { accessor.setShort(host, Short.parseShort(value)); } else if (valueClass.isEnum()) { //noinspection unchecked accessor.set(host, ClassUtil.stringToEnum(value, (Class<? extends Enum<?>>)valueClass, false)); } else if (Date.class.isAssignableFrom(valueClass)) { try { accessor.set(host, new Date(Long.parseLong(value))); } catch (NumberFormatException e) { accessor.set(host, new Date(0)); } } else { Object deserializedValue = value; if (valueClass == Boolean.class) { deserializedValue = Boolean.parseBoolean(value); } else if (valueClass == Integer.class) { deserializedValue = Integer.parseInt(value); } else if (valueClass == Short.class) { deserializedValue = Short.parseShort(value); } else if (valueClass == Long.class) { deserializedValue = Long.parseLong(value); } else if (valueClass == Double.class) { deserializedValue = Double.parseDouble(value); } else if (valueClass == Float.class) { deserializedValue = Float.parseFloat(value); } else if (callFromStringIfDefined(host, value, accessor, valueClass)) { return; } accessor.set(host, deserializedValue); } }