Compare commits

..

2 Commits

Author SHA1 Message Date
8acec7446a 添加 EditorConfig 配置。 2023-11-08 18:11:26 +08:00
737c769c56 忽略未检查类型转换的警告 2023-11-08 18:11:06 +08:00
2 changed files with 14 additions and 0 deletions

12
.editorconfig Normal file
View File

@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true

View File

@ -35,6 +35,7 @@ public class MapValidator {
this.rules.add(rule);
}
@SuppressWarnings("unchecked")
protected final <R> ObjectValidator<Map<String, Object>, R> ruleFor(String key) {
ObjectValidator<Map<String, Object>, R> validValueHolder = new ObjectValidator<>(map -> (R) map.get(key));
propertyValidators.add(validValueHolder);
@ -65,6 +66,7 @@ public class MapValidator {
return validValueHolder;
}
@SuppressWarnings("unchecked")
protected final <E> CollectionValidator<Map<String, Object>, E> ruleForCollection(String key) {
CollectionValidator<Map<String, Object>, E> validValueHolder = new CollectionValidator<>(m -> (Collection<E>) m.get(key));
propertyValidators.add(validValueHolder);