|
0a83116e81
|
refactor: 将方法调用与返回语句合并,简化了代码结构
|
2025-06-01 20:16:42 +08:00 |
|
|
907d883be8
|
feat: 添加数组属性校验器
- 新增 `ArrayPropertyValidator` 类,提供针对数组类型的属性校验功能。
- 在 `BaseValidator` 中添加 `ruleForArray` 方法,用于创建数组属性校验器。
|
2025-06-01 19:00:10 +08:00 |
|
|
7a9e15fd45
|
refactor: 优化集合属性校验器
- 更新类注释
- 优化 allMatch 方法的实现,使用 forEach 替代 stream().forEach()
|
2025-06-01 18:57:58 +08:00 |
|
|
b29e1e07aa
|
feat: 为 CollectionPropertyValidator 添加 allMatch 方法
- 新增 allMatch 方法,用于校验集合中的所有元素是否满足指定条件。支持自定义异常信息和异常类型。
- 添加相关单元测试用例。
|
2025-06-01 18:10:36 +08:00 |
|
|
3f23d5383d
|
refactor: 默认使用 SimpleImmutableEntry 作为二元组
- 在 `MapValidator` 类中,将 `SimpleEntry` 替换为 `SimpleImmutableEntry`,作为二元组的默认实现。
- 在 `PairPropertyValidatorTests` 类中,做同样的替换。
|
2025-06-01 08:56:00 +08:00 |
|
|
c27525a637
|
test: 修改测试用例以覆盖 BaseValidator#ruleFor
|
2025-06-01 08:48:23 +08:00 |
|
|
3ef2ebac2f
|
feat: 添加二元组属性校验支持
- 新增 `PairPropertyValidator` 类,用于校验二元组属性
- 在 `BaseValidator` 和 `MapValidator` 中添加对二元组校验器的支持
- 添加相关单元测试
|
2025-06-01 08:46:13 +08:00 |
|
|
8be8be8f17
|
chore: 更新 README 中的示例
|
2025-06-01 06:48:30 +08:00 |
|
|
5603b72897
|
chore: 更新 README 中的许可证链接
|
2025-06-01 06:11:59 +08:00 |
|
|
2ac8e39387
|
chore: 添加 README
|
2025-06-01 06:01:06 +08:00 |
|
|
3b9a224e72
|
refactor: 修改 MapValidator#ruleFor 的泛型以支持使用具体类型的规则
|
2025-06-01 05:42:10 +08:00 |
|
|
44ea11e0e9
|
refactor!: 删除 BasePropertyValidator 多余的 withRule 方法
|
2025-06-01 05:40:30 +08:00 |
|
|
2d769fde26
|
refactor!: 校验不通过时默认抛出 ValidationException 而不是 IllegalArgumentException
- 新增 `ValidationException`
- 校验不通过时默认抛出 `ValidationException` 而不是 `IllegalArgumentException`
- 更新了相关的测试用例
|
2025-06-01 02:58:12 +08:00 |
|
|
a4d91dde35
|
docs: 完善文档注释
|
2025-05-29 02:45:58 +08:00 |
|
|
9f0c7cd2fb
|
refactor: 新增 IValidator 接口
- 让 BaseValidator 继承自 IValidator 接口
- 更新相关测试用例中的类型引用
|
2025-05-28 23:09:52 +08:00 |
|
|
0a5dbd9f53
|
refactor!: 删除意义不大的 Validator 类
|
2025-05-28 23:06:48 +08:00 |
|
|
2d6ead8417
|
docs: 更改 @author 信息
|
2025-05-28 22:04:55 +08:00 |
|
|
0e9dbf9bd9
|
refactor!: BasePropertyValidator 的 equalsThat 重命名为 equalTo
|
2025-05-28 14:30:06 +08:00 |
|
|
f21e9727fa
|
refactor!: 修改异常信息
|
2025-05-28 14:28:09 +08:00 |
|
|
33fb20590b
|
chore: 补充 copyright 声明
|
2025-05-28 14:27:28 +08:00 |
|
|
08ebfc7d4b
|
docs: 删除关于 ValidTools 的描述
|
2025-05-28 14:26:12 +08:00 |
|
|
41ccb652d4
|
feat: 重载 ruleFor
通过自定义函数式接口,使 lambda 表达式作为入参时,可以进入不同的重载版本,从而返回不同类型属性的校验器。
|
2025-05-28 09:41:02 +08:00 |
|
|
37f4af67cd
|
feat: 添加 MapValidator#ruleForComparable
|
2025-05-28 09:40:00 +08:00 |
|
|
6cd47e369e
|
test: 添加 BasePropertyValidator#withRule 的反用例
|
2025-05-28 09:38:48 +08:00 |
|
|
dd8ae71192
|
更新项目描述
|
2025-05-28 03:12:18 +08:00 |
|
|
f15178f500
|
Merge branch 'prepare/1.0.0' of http://zhouxy.xyz:3000/plusone/plusone-validator into prepare/1.0.0
|
2025-05-28 03:02:19 +08:00 |
|
|
83d9b05d63
|
test: 完成单元测试
|
2025-05-28 02:36:34 +08:00 |
|
|
d81e6acc23
|
fix: StringPropertyValidator 默认匹配正则时不对 null 进行校验
|
2025-05-28 02:36:14 +08:00 |
|
|
124ce63323
|
refactor!: 删除 ValidTools
|
2025-05-28 02:35:21 +08:00 |
|
|
ff374a049e
|
style: 格式化代码
|
2025-05-28 00:00:55 +08:00 |
|
|
ae970cb393
|
feat: 重载校验规则
`BasePropertyValidator#notNull`、`CollectionPropertyValidator#notEmpty` 和 `CollectionPropertyValidator#isEmpty` 提供无参的版本
|
2025-05-27 23:53:58 +08:00 |
|
|
a28a6135a8
|
refactor: 优化错误提示
|
2025-05-27 23:46:09 +08:00 |
|
|
9f2ade6252
|
refactor: 修改类型参数名称
|
2025-05-27 23:33:03 +08:00 |
|
|
e38be765a7
|
refactor!: 修改字符串校验逻辑
`StringPropertyValidator` 内置的校验规则中,除了 `notEmpty` 和 `notBlank` 之外,属性值为 null 时不做校验。
|
2025-05-20 18:00:19 +08:00 |
|
|
bce648dc51
|
test: 完善单元测试
|
2025-05-20 17:41:23 +08:00 |
|
|
ad74a0bcd0
|
test: 完成 ComparablePropertyValidator 单元测试
|
2025-05-20 11:36:24 +08:00 |
|
|
dcf620b63e
|
refactor: 修改 BaseComparablePropertyValidator#inRange 默认提示语
|
2025-05-20 11:36:21 +08:00 |
|
|
358cdaf1ad
|
test: 完善单元测试
|
2025-05-20 11:36:17 +08:00 |
|
|
07483627a8
|
refactor!: StringPropertyValidator#length 使用闭区间
`StringPropertyValidator#length` 校验字符串长度在区间内时,要求字符串长度大于等于最小长度(min),小于等于最大长度(max)。
|
2025-05-20 11:08:52 +08:00 |
|
|
45dc111eb6
|
更新项目描述
|
2025-05-20 00:41:25 +08:00 |
|
|
19b7926f0d
|
refactor!: 修改数值校验器的 API
原 `IntPropertyValidator`、`LongPropertyValidator` 和 `DoublePropertyValidator` 的
`between` 方法,使用“左闭右开”区间,但方法签名上并不明确,容易产生歧义。
现改为 `gt`(GreaterThan)、`ge`(GreaterThanOrEqualTo)、`lt`(LessThan)、`le`(LessThanOrEqualTo)。
|
2025-05-19 21:16:27 +08:00 |
|
|
297649c63a
|
refactor: StringPropertyValidator 的 isNullOrEmpty 使用 Strings#isNullOrEmpty 进行逻辑判断
|
2025-05-19 20:41:47 +08:00 |
|
|
a9df6f8c0e
|
fix: 修改 StringPropertyValidator#length 中的错误信息
|
2025-05-19 17:33:01 +08:00 |
|
|
6585750e65
|
refactor!: StringPropertyValidator 的 email 方法重命名为 emailAddress
|
2025-05-19 17:29:39 +08:00 |
|
|
1b8a5634b3
|
refactor!: BasePropertyValidator 的 between 方法重命名为 inRange
1. `BasePropertyValidator` 的 `between` 方法重命名为 `inRange`,更符合语义;
2. 将判空作为规则的一部分。
|
2025-05-19 17:28:45 +08:00 |
|
|
ecdd0a616a
|
refactor!: BasePropertyValidator#isTrue 重命名为 must
|
2025-05-19 17:11:13 +08:00 |
|
|
dc28befe88
|
refactor!: DefaultComparablePropertyValidator 重命名为 ComparablePropertyValidator
|
2025-05-19 16:13:44 +08:00 |
|
|
73b7827e5f
|
refactor!: ComparablePropertyValidator 重命名为 BaseComparablePropertyValidator
|
2025-05-19 16:12:25 +08:00 |
|
|
6868a81c59
|
chore: 添加 Copyright 信息
|
2025-05-19 16:04:19 +08:00 |
|
|
5bd19b924a
|
add LICENSE.
Signed-off-by: ZhouXY108 <luquanlion@outlook.com>
|
2025-05-18 07:49:17 +00:00 |
|