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

Side by Side Diff: lib/protobuf/runtime/ProtobufEnum.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, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/protobuf/runtime/Protobuf.dart ('k') | lib/protobuf/runtime/Protobuf_client.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 class ProtobufEnum {
5 final int _index;
6 final int _value;
7 final String _name;
8
9 const ProtobufEnum(this._index, this._value, this._name);
10
11 static Map<int, ProtobufEnum> initByValue(List<ProtobufEnum> byIndex) {
12 Map<int, ProtobufEnum> byValue = new Map<int, Dynamic>();
13 for (ProtobufEnum v in byIndex) {
14 byValue[v.value] = v;
15 }
16 return byValue;
17 }
18
19 int hashCode() => _value;
20 String get name() => _name;
21 int get value() => _value;
22 int get index() => _index;
23 }
OLDNEW
« no previous file with comments | « lib/protobuf/runtime/Protobuf.dart ('k') | lib/protobuf/runtime/Protobuf_client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698