Class PatchBuilder
- java.lang.Object
-
- org.springframework.social.google.api.impl.PatchBuilder
-
public class PatchBuilder extends Object
A builder of a map to be used as the request body of PATCH operations. The following code:new PatchBuilder() .set("labels.starred", true) .set("labels.hidden", false) .getMap();returns a Map, which will be serialized to the following JSON:{ "labels": { "starred": true, "hidden": false } }- Author:
- Gabriel Axel
- See Also:
AbstractGoogleApiOperations.patch(String, Object, Class)
-
-
Field Summary
Fields Modifier and Type Field Description static StringPATH_DELIMITER
-
Constructor Summary
Constructors Constructor Description PatchBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PatchBuilderdelete(String path)Defines a property to be deleted by setting its value to null.Map<String,Object>getMap()Returns the map created so farPatchBuilderset(String path, Enum<?> value)Adds a property and a value to be set in the PATCH requestPatchBuilderset(String path, Object value)Adds a property and a value to be set in the PATCH request
-
-
-
Field Detail
-
PATH_DELIMITER
public static final String PATH_DELIMITER
- See Also:
- Constant Field Values
-
-
Method Detail
-
set
public PatchBuilder set(String path, Object value)
Adds a property and a value to be set in the PATCH request- Parameters:
path- the path representing the property, with "." representing nested propertiesvalue- the value to be set for the property- Returns:
- the
PatchBuilderinstance
-
set
public PatchBuilder set(String path, Enum<?> value)
Adds a property and a value to be set in the PATCH request- Parameters:
path- the path representing the property, with "." representing nested propertiesvalue- the value to be set for the property- Returns:
- the
PatchBuilderinstance
-
delete
public PatchBuilder delete(String path)
Defines a property to be deleted by setting its value to null. Equivalent to invokingset(String, Object)with null value- Parameters:
path- the path representing the property, with "." representing nested properties- Returns:
- the
PatchBuilderinstance
-
-