Skip to content

Commit

Permalink
Improved documentation of the two new methods.
Browse files Browse the repository at this point in the history
Signed-off-by: Johyn Papin <contact@johyn.me>
  • Loading branch information
Johyn Papin committed May 7, 2023
1 parent 661050f commit 54bbcb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion protobuf/lib/src/protobuf/field_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,9 @@ class _FieldSet {
_setNonExtensionFieldUnchecked(meta, fi, value);
}

/// Sets a non-repeated nullable field with error-checking.
/// Sets a non-repeated field with error-checking.
/// This method behaves like [_setField], except if `null` is passed as
/// value. In this case, [_clearField] will be called.
///
/// Works for both extended and non-extended fields.
/// Suitable for public API.
Expand Down
2 changes: 2 additions & 0 deletions protobuf/lib/src/protobuf/generated_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ abstract class GeneratedMessage {
}

/// Sets the value of a field by its [tagNumber].
/// This method should be used for optional fields when the nullable option
/// is set. When `null` is passed as value, the field is cleared.
///
/// Throws an [ArgumentError] if [value] does not match the type associated
/// with [tagNumber].
Expand Down

0 comments on commit 54bbcb2

Please sign in to comment.