Package jsonvalues
Class Patch.Builder
- java.lang.Object
-
- jsonvalues.Patch.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Patch.Builder
add(String path, JsElem value)
ADD operation.Patch.Builder
copy(String from, String to)
COPY operation.Patch.Builder
move(String from, String to)
MOVE operation.Patch.Builder
remove(String path)
REMOVE operation.Patch.Builder
replace(String path, JsElem value)
REPLACE operation.Patch.Builder
test(String path, JsElem value)
TEST operation.JsArray
toArray()
returns the array of operationsString
toString()
returns the array of operations as a string
-
-
-
Method Detail
-
add
public Patch.Builder add(String path, JsElem value)
ADD operation.- Parameters:
path
- target location of the operationvalue
- element to be added- Returns:
- this builder with an ADD operation appended
-
replace
public Patch.Builder replace(String path, JsElem value)
REPLACE operation.- Parameters:
path
- target location of the operationvalue
- element to be replaced with- Returns:
- this builder with a REPLACE operation appended
-
remove
public Patch.Builder remove(String path)
REMOVE operation.- Parameters:
path
- target location of the operation- Returns:
- this builder with a REMOVE operation appended
-
test
public Patch.Builder test(String path, JsElem value)
TEST operation.- Parameters:
path
- target location of the operationvalue
- element to be tested- Returns:
- this builder with a TEST operation appended
-
move
public Patch.Builder move(String from, String to)
MOVE operation.- Parameters:
from
- target location of the operationto
- source location of the operation- Returns:
- this builder with a MOVE operation appended
-
copy
public Patch.Builder copy(String from, String to)
COPY operation.- Parameters:
from
- target location of the operationto
- source location of the operation- Returns:
- this builder with a COPY operation appended
-
toArray
public JsArray toArray()
returns the array of operations- Returns:
- a JsArray
-
-