no message
Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -30,7 +30,7 @@ public class AtLeastOneNonNullValidator implements ConstraintValidator<AtLeastOn | ... | @@ -30,7 +30,7 @@ public class AtLeastOneNonNullValidator implements ConstraintValidator<AtLeastOn |
| 30 | try { | 30 | try { |
| 31 | Field field = object.getClass().getDeclaredField(fieldName); | 31 | Field field = object.getClass().getDeclaredField(fieldName); |
| 32 | field.setAccessible(true); // 设置私有字段可访问,以便读取值 | 32 | field.setAccessible(true); // 设置私有字段可访问,以便读取值 |
| 33 | System.out.println(field.getName()+"============"+field.get(object)); | 33 | System.out.println(field.getName()+"============"+field.get(object)+"!"); |
| 34 | if (Objects.nonNull(field.get(object))) { // 检查字段是否非空 | 34 | if (Objects.nonNull(field.get(object))) { // 检查字段是否非空 |
| 35 | return true; // 如果至少一个字段非空,返回true | 35 | return true; // 如果至少一个字段非空,返回true |
| 36 | } | 36 | } | ... | ... |
-
Please register or sign in to post a comment