忽略未检查类型转换的警告
This commit is contained in:
parent
7a3801affe
commit
737c769c56
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user