Class JsonPatch.Builder
java.lang.Object
cloud.opencode.base.json.patch.JsonPatch.Builder
- Enclosing class:
JsonPatch
Builder for JsonPatch.
JsonPatch 的构建器。
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionAdds an add operation.build()Builds the patch.Adds a copy operation.Adds a move operation.Adds a remove operation.Adds a replace operation.Adds a test operation.
-
Method Details
-
add
Adds an add operation. 添加一个 add 操作。- Parameters:
path- the JSON Pointer path - JSON Pointer 路径value- the value to add - 要添加的值- Returns:
- this builder - 此构建器
-
remove
Adds a remove operation. 添加一个 remove 操作。- Parameters:
path- the JSON Pointer path - JSON Pointer 路径- Returns:
- this builder - 此构建器
-
replace
Adds a replace operation. 添加一个 replace 操作。- Parameters:
path- the JSON Pointer path - JSON Pointer 路径value- the new value - 新值- Returns:
- this builder - 此构建器
-
move
Adds a move operation. 添加一个 move 操作。- Parameters:
from- the source path - 源路径path- the target path - 目标路径- Returns:
- this builder - 此构建器
-
copy
Adds a copy operation. 添加一个 copy 操作。- Parameters:
from- the source path - 源路径path- the target path - 目标路径- Returns:
- this builder - 此构建器
-
test
Adds a test operation. 添加一个 test 操作。- Parameters:
path- the JSON Pointer path - JSON Pointer 路径expected- the expected value - 预期值- Returns:
- this builder - 此构建器
-
build
-