Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Unified Diff: lib/protobuf/runtime/Extension.dart

Issue 10595002: Protocol Buffer runtime library and 'protoc' plugin (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Work around http://code.google.com/p/dart/issues/detail?id=3806 Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/protobuf/runtime/DynamicGeneratedMessage.dart ('k') | lib/protobuf/runtime/ExtensionRegistry.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/protobuf/runtime/Extension.dart
diff --git a/lib/protobuf/runtime/Extension.dart b/lib/protobuf/runtime/Extension.dart
new file mode 100644
index 0000000000000000000000000000000000000000..fc8e9b9208fdd4ed36d5651526e6a6657f7cba9a
--- /dev/null
+++ b/lib/protobuf/runtime/Extension.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * An object representing an extension field.
+ */
+class Extension extends FieldInfo {
+
+ final String extendee;
+
+ Extension(String this.extendee, String name, int tagNumber, int fieldType,
+ [MakeDefaultFunc makeDefault, CreateBuilderFunc subBuilder = null,
+ ValueOfFunc valueOf = null]) :
+ super(name, tagNumber, fieldType, makeDefault, subBuilder, valueOf);
+
+ int hashCode() => extendee.hashCode() * 31 + tagNumber;
+
+ bool operator ==(Extension o) {
+ if (o is! Extension) {
+ return false;
+ }
+ return extendee == o.extendee && tagNumber == o.tagNumber;
+ }
+}
+
« no previous file with comments | « lib/protobuf/runtime/DynamicGeneratedMessage.dart ('k') | lib/protobuf/runtime/ExtensionRegistry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698