Package com.google.protobuf.util
Class FieldMaskUtil.MergeOptions
java.lang.Object
com.google.protobuf.util.FieldMaskUtil.MergeOptions
- Enclosing class:
FieldMaskUtil
Options to customize merging behavior.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether to replace message fields (i.e., discard existing content in destination message fields).boolean
Whether to replace primitive (non-repeated and non-message) fields in destination message fields with the source primitive fields (i.e., clear destination field if source field is not set).boolean
Whether to replace repeated fields (i.e., discard existing content in destination repeated fields).setReplaceMessageFields
(boolean value) Specify whether to replace message fields.setReplacePrimitiveFields
(boolean value) Specify whether to replace primitive (non-repeated and non-message) fields in destination message fields with the source primitive fields.setReplaceRepeatedFields
(boolean value) Specify whether to replace repeated fields.
-
Constructor Details
-
MergeOptions
public MergeOptions()
-
-
Method Details
-
replaceMessageFields
public boolean replaceMessageFields()Whether to replace message fields (i.e., discard existing content in destination message fields). -
replaceRepeatedFields
public boolean replaceRepeatedFields()Whether to replace repeated fields (i.e., discard existing content in destination repeated fields). -
replacePrimitiveFields
public boolean replacePrimitiveFields()Whether to replace primitive (non-repeated and non-message) fields in destination message fields with the source primitive fields (i.e., clear destination field if source field is not set). -
setReplaceMessageFields
Specify whether to replace message fields. Defaults to false.If true, discard existing content in destination message fields when merging.
If false, merge the source message field into the destination message field.
-
setReplaceRepeatedFields
Specify whether to replace repeated fields. Defaults to false.If true, discard existing content in destination repeated fields) when merging.
If false, append elements from source repeated field to the destination repeated field.
-
setReplacePrimitiveFields
Specify whether to replace primitive (non-repeated and non-message) fields in destination message fields with the source primitive fields. Defaults to false.If true, set the value of the destination primitive field to the source primitive field if the source field is set, but clear the destination field otherwise.
If false, always set the value of the destination primitive field to the source primitive field, and if the source field is unset, the default value of the source field is copied to the destination.
-