Package com.google.protobuf.util
Class FieldMaskUtil.MergeOptions
- java.lang.Object
-
- com.google.protobuf.util.FieldMaskUtil.MergeOptions
-
- Enclosing class:
- FieldMaskUtil
public static final class FieldMaskUtil.MergeOptions extends java.lang.ObjectOptions to customize merging behavior.
-
-
Constructor Summary
Constructors Constructor Description MergeOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanreplaceMessageFields()Whether to replace message fields (i.e., discard existing content in destination message fields).booleanreplacePrimitiveFields()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).booleanreplaceRepeatedFields()Whether to replace repeated fields (i.e., discard existing content in destination repeated fields).FieldMaskUtil.MergeOptionssetReplaceMessageFields(boolean value)Specify whether to replace message fields.FieldMaskUtil.MergeOptionssetReplacePrimitiveFields(boolean value)Specify whether to replace primitive (non-repeated and non-message) fields in destination message fields with the source primitive fields.FieldMaskUtil.MergeOptionssetReplaceRepeatedFields(boolean value)Specify whether to replace repeated fields.
-
-
-
Method Detail
-
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
@CanIgnoreReturnValue public FieldMaskUtil.MergeOptions setReplaceMessageFields(boolean value)
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
@CanIgnoreReturnValue public FieldMaskUtil.MergeOptions setReplaceRepeatedFields(boolean value)
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
@CanIgnoreReturnValue public 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. 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.
-
-