public class FieldMaskUtil extends Object
FieldMask.| Modifier and Type | Class and Description |
|---|---|
static class |
FieldMaskUtil.MergeOptions
Options to customize merging behavior.
|
| Modifier and Type | Method and Description |
|---|---|
static com.google.protobuf.FieldMask |
fromFieldNumbers(Class<? extends com.google.protobuf.Message> type,
int... fieldNumbers)
Constructs a FieldMask from the passed field numbers.
|
static com.google.protobuf.FieldMask |
fromFieldNumbers(Class<? extends com.google.protobuf.Message> type,
Iterable<Integer> fieldNumbers)
Constructs a FieldMask from the passed field numbers.
|
static com.google.protobuf.FieldMask |
fromJsonString(String value)
Converts a field mask from a Proto3 JSON string, that is splitting the paths along commas and
converting from camel case to snake case.
|
static com.google.protobuf.FieldMask |
fromString(Class<? extends com.google.protobuf.Message> type,
String value)
Parses from a string to a FieldMask and validates all field paths.
|
static com.google.protobuf.FieldMask |
fromString(String value)
Parses from a string to a FieldMask.
|
static com.google.protobuf.FieldMask |
fromStringList(Class<? extends com.google.protobuf.Message> type,
Iterable<String> paths)
Constructs a FieldMask for a list of field paths in a certain type.
|
static com.google.protobuf.FieldMask |
intersection(com.google.protobuf.FieldMask mask1,
com.google.protobuf.FieldMask mask2)
Calculates the intersection of two FieldMasks.
|
static boolean |
isValid(Class<? extends com.google.protobuf.Message> type,
com.google.protobuf.FieldMask fieldMask)
Checks whether paths in a given fields mask are valid.
|
static boolean |
isValid(Class<? extends com.google.protobuf.Message> type,
String path)
Checks whether a given field path is valid.
|
static boolean |
isValid(com.google.protobuf.Descriptors.Descriptor descriptor,
com.google.protobuf.FieldMask fieldMask)
Checks whether paths in a given fields mask are valid.
|
static boolean |
isValid(com.google.protobuf.Descriptors.Descriptor descriptor,
String path)
Checks whether paths in a given fields mask are valid.
|
static void |
merge(com.google.protobuf.FieldMask mask,
com.google.protobuf.Message source,
com.google.protobuf.Message.Builder destination)
Merges fields specified by a FieldMask from one message to another.
|
static void |
merge(com.google.protobuf.FieldMask mask,
com.google.protobuf.Message source,
com.google.protobuf.Message.Builder destination,
FieldMaskUtil.MergeOptions options)
Merges fields specified by a FieldMask from one message to another with the
specified merge options.
|
static com.google.protobuf.FieldMask |
normalize(com.google.protobuf.FieldMask mask)
Converts a FieldMask to its canonical form.
|
static String |
toJsonString(com.google.protobuf.FieldMask fieldMask)
Converts a field mask to a Proto3 JSON string, that is converting from snake case to camel
case and joining all paths into one string with commas.
|
static String |
toString(com.google.protobuf.FieldMask fieldMask)
Converts a FieldMask to a string.
|
static com.google.protobuf.FieldMask |
union(com.google.protobuf.FieldMask firstMask,
com.google.protobuf.FieldMask secondMask,
com.google.protobuf.FieldMask... otherMasks)
Creates a union of two or more FieldMasks.
|
public static String toString(com.google.protobuf.FieldMask fieldMask)
public static com.google.protobuf.FieldMask fromString(String value)
public static com.google.protobuf.FieldMask fromString(Class<? extends com.google.protobuf.Message> type, String value)
IllegalArgumentException - if any of the field path is invalid.public static com.google.protobuf.FieldMask fromStringList(Class<? extends com.google.protobuf.Message> type, Iterable<String> paths)
IllegalArgumentException - if any of the field path is not valid.public static com.google.protobuf.FieldMask fromFieldNumbers(Class<? extends com.google.protobuf.Message> type, int... fieldNumbers)
IllegalArgumentException - if any of the fields are invalid for the message.public static com.google.protobuf.FieldMask fromFieldNumbers(Class<? extends com.google.protobuf.Message> type, Iterable<Integer> fieldNumbers)
IllegalArgumentException - if any of the fields are invalid for the message.public static String toJsonString(com.google.protobuf.FieldMask fieldMask)
public static com.google.protobuf.FieldMask fromJsonString(String value)
public static boolean isValid(Class<? extends com.google.protobuf.Message> type, com.google.protobuf.FieldMask fieldMask)
public static boolean isValid(com.google.protobuf.Descriptors.Descriptor descriptor,
com.google.protobuf.FieldMask fieldMask)
public static boolean isValid(Class<? extends com.google.protobuf.Message> type, String path)
public static boolean isValid(com.google.protobuf.Descriptors.Descriptor descriptor,
String path)
public static com.google.protobuf.FieldMask normalize(com.google.protobuf.FieldMask mask)
public static com.google.protobuf.FieldMask union(com.google.protobuf.FieldMask firstMask,
com.google.protobuf.FieldMask secondMask,
com.google.protobuf.FieldMask... otherMasks)
public static com.google.protobuf.FieldMask intersection(com.google.protobuf.FieldMask mask1,
com.google.protobuf.FieldMask mask2)
public static void merge(com.google.protobuf.FieldMask mask,
com.google.protobuf.Message source,
com.google.protobuf.Message.Builder destination,
FieldMaskUtil.MergeOptions options)
public static void merge(com.google.protobuf.FieldMask mask,
com.google.protobuf.Message source,
com.google.protobuf.Message.Builder destination)
Copyright © 2008–2016 Google. All rights reserved.