Skip to content

Commit

Permalink
Final Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
FxMorin committed Mar 1, 2022
1 parent 49d3c25 commit e94202e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/carpetfixes/settings/CustomSettingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ public int printAllRulesToLog(String category) {
} else if(type == String.class && categories.contains(RuleCategory.COMMAND)) {
options = List.of("true", "false", "ops");
} else if (type.isEnum()) {
options = Arrays.stream(type.getEnumConstants()).map(e -> ((Enum) e).name().toLowerCase(Locale.ROOT))
.collect(Collectors.toUnmodifiableList());
options = Arrays.stream(type.getEnumConstants()).map(e ->
((Enum<?>) e).name().toLowerCase(Locale.ROOT)).toList();
} else {
options = List.of();
}
List<Validator<?>> validators = new ArrayList<>();
for (Class v : rule.validate())
for (Class<?> v : rule.validate())
validators.add((Validator<?>) callConstructor(v));
if (categories.contains(RuleCategory.COMMAND)) {
validators.add(callConstructor(Validator._COMMAND.class));
Expand Down Expand Up @@ -133,7 +133,7 @@ private <T> T callConstructor(Class<T> cls) {
}

private static String convertToString(Object value) {
if (value instanceof Enum) return ((Enum) value).name().toLowerCase(Locale.ROOT);
if (value instanceof Enum) return ((Enum<?>) value).name().toLowerCase(Locale.ROOT);
return value.toString();
}
}

0 comments on commit e94202e

Please sign in to comment.