More GeneratedMessage docs, hide meta library (#882)
diff --git a/protobuf/lib/meta.dart b/protobuf/lib/meta.dart
index 2b249d1..7f43263 100644
--- a/protobuf/lib/meta.dart
+++ b/protobuf/lib/meta.dart
@@ -4,6 +4,7 @@
/// Provides metadata about GeneratedMessage and ProtobufEnum to
/// dart-protoc-plugin. (Experimental API; subject to change.)
+/// @nodoc
library protobuf.meta;
// ignore_for_file: constant_identifier_names
diff --git a/protobuf/lib/src/protobuf/field_set.dart b/protobuf/lib/src/protobuf/field_set.dart
index fe5b7e0..0c8b064 100644
--- a/protobuf/lib/src/protobuf/field_set.dart
+++ b/protobuf/lib/src/protobuf/field_set.dart
@@ -91,10 +91,10 @@
String get _messageName => _meta.qualifiedMessageName;
bool get _hasRequiredFields => _meta.hasRequiredFields;
- /// The FieldInfo for each non-extension field.
+ /// The [FieldInfo] for each non-extension field.
Iterable<FieldInfo> get _infos => _meta.fieldInfo.values;
- /// The FieldInfo for each non-extension field in tag order.
+ /// The [FieldInfo] for each non-extension field in tag order.
Iterable<FieldInfo> get _infosSortedByTag => _meta.sortedByTag;
_ExtensionFieldSet _ensureExtensions() =>
diff --git a/protobuf/lib/src/protobuf/generated_message.dart b/protobuf/lib/src/protobuf/generated_message.dart
index 6239e0e..b6c3527 100644
--- a/protobuf/lib/src/protobuf/generated_message.dart
+++ b/protobuf/lib/src/protobuf/generated_message.dart
@@ -137,7 +137,7 @@
@override
int get hashCode => _fieldSet._hashCode;
- /// Returns a String representation of this message.
+ /// Returns a [String] representation of this message.
///
/// This representation is similar to, but not quite, the Protocol Buffer
/// TextFormat. Each field is printed on its own line. Sub-messages are
@@ -148,7 +148,7 @@
@override
String toString() => toDebugString();
- /// Returns a String representation of this message.
+ /// Returns a [String] representation of this message.
///
/// This generates the same output as [toString], but can be used by mixins
/// to compose debug strings with additional information.
@@ -158,6 +158,11 @@
return out.toString();
}
+ /// Throws a [StateError] if the message has required fields without a value.
+ ///
+ /// This library does not check in any of the methods that required fields in
+ /// have values. Use this method if you need to check that required fields
+ /// have values.
void check() {
if (!isInitialized()) {
final invalidFields = <String>[];
@@ -167,15 +172,18 @@
}
}
+ /// Serialize the message as the protobuf binary format.
Uint8List writeToBuffer() {
final out = CodedBufferWriter();
writeToCodedBufferWriter(out);
return out.toBuffer();
}
+ /// Same as [writeToBuffer], but serializes to the given [CodedBufferWriter].
void writeToCodedBufferWriter(CodedBufferWriter output) =>
_writeToCodedBufferWriter(_fieldSet, output);
+ /// Same as [mergeFromBuffer], but takes a [CodedBufferReader] input.
void mergeFromCodedBufferReader(CodedBufferReader input,
[ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) {
final meta = _fieldSet._meta;