OLD | NEW |
(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 } |
OLD | NEW |