private String getDescription(TransferSettings settings, TransferPluginOption option) {
Class<?> clazzForType = ReflectionUtil.getClassFromType(option.getType());
if (clazzForType != null && Enum.class.isAssignableFrom(clazzForType)) {
Object[] enumValues = clazzForType.getEnumConstants();
if (enumValues == null) {
throw new RuntimeException("Invalid TransferSettings class found: Enum at " + settings + " has no values");
}
logger.log(Level.FINE, "Found enum option, values are: " + StringUtil.join(enumValues, ", "));
return String.format("%s, choose from %s", option.getDescription(), StringUtil.join(enumValues, ", "));
}
else {
return option.getDescription();
}
}