public static final class FieldMaskUtil.MergeOptions
extends java.lang.Object
Constructor and Description |
---|
MergeOptions() |
Modifier and Type | Method and Description |
---|---|
boolean |
replaceMessageFields()
Whether to replace message fields (i.e., discard existing content in
destination message fields).
|
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).
|
boolean |
replaceRepeatedFields()
Whether to replace repeated fields (i.e., discard existing content in
destination repeated fields).
|
FieldMaskUtil.MergeOptions |
setReplaceMessageFields(boolean value)
Specify whether to replace message fields.
|
FieldMaskUtil.MergeOptions |
setReplacePrimitiveFields(boolean value)
Specify whether to replace primitive (non-repeated and non-message) fields in destination
message fields with the source primitive fields.
|
FieldMaskUtil.MergeOptions |
setReplaceRepeatedFields(boolean value)
Specify whether to replace repeated fields.
|
public boolean replaceMessageFields()
public boolean replaceRepeatedFields()
public boolean replacePrimitiveFields()
@CanIgnoreReturnValue public FieldMaskUtil.MergeOptions setReplaceMessageFields(boolean value)
If true, discard existing content in destination message fields when merging.
If false, merge the source message field into the destination message field.
@CanIgnoreReturnValue public FieldMaskUtil.MergeOptions setReplaceRepeatedFields(boolean value)
If true, discard existing content in destination repeated fields) when merging.
If false, append elements from source repeated field to the destination repeated field.
@CanIgnoreReturnValue public FieldMaskUtil.MergeOptions setReplacePrimitiveFields(boolean value)
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.