/** * Parses from a string to a FieldMask. */ public static FieldMask fromString(String value) { // TODO(xiaofeng): Consider using com.google.common.base.Splitter here instead. return fromStringList(null, Arrays.asList(value.split(FIELD_PATH_SEPARATOR_REGEX))); }
/** * Parses from a string to a FieldMask and validates all field paths. * * @throws IllegalArgumentException if any of the field path is invalid. */ public static FieldMask fromString(Class<? extends Message> type, String value) { // TODO(xiaofeng): Consider using com.google.common.base.Splitter here instead. return fromStringList(type, Arrays.asList(value.split(FIELD_PATH_SEPARATOR_REGEX))); }