Skip to content

Commit

Permalink
Add support for setting int and double array fields
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-wilke committed Dec 6, 2021
1 parent 1f27427 commit f4fa77b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ public static <T> boolean setFieldValue(
return setValue(cls, instance, fieldName, value);
} else if (field.getType().equals(String[].class)) {
return setValue(cls, instance, fieldName, value.split(","));
} else if (field.getType() instanceof Class && field.getType().isEnum()) {
} else if (field.getType().equals(int[].class)) {
return setValue(cls, instance, fieldName, ArrayUtilities.splitInt(value, ","));
} else if (field.getType().equals(double[].class)) {
return setValue(cls, instance, fieldName, ArrayUtilities.splitDouble(value, ","));
}else if (field.getType() instanceof Class && field.getType().isEnum()) {
return setEnumPropertyValue(cls, instance, field, fieldName, value);
} else if (field.getType().equals(Material.class)) {
return setValue(cls, instance, fieldName, Material.get(value));
Expand Down

0 comments on commit f4fa77b

Please sign in to comment.