no message
Showing
1 changed file
with
1 additions
and
0 deletions
| ... | @@ -32,6 +32,7 @@ public class AtLeastOneNonNullValidator implements ConstraintValidator<AtLeastOn | ... | @@ -32,6 +32,7 @@ public class AtLeastOneNonNullValidator implements ConstraintValidator<AtLeastOn |
| 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 | System.out.println(field.getName()+"============"+field.get(object)+"&"); | ||
| 35 | return true; // 如果至少一个字段非空,返回true | 36 | return true; // 如果至少一个字段非空,返回true |
| 36 | } | 37 | } |
| 37 | } catch (NoSuchFieldException | IllegalAccessException e) { | 38 | } catch (NoSuchFieldException | IllegalAccessException e) { | ... | ... |
-
Please register or sign in to post a comment