initByValue<T extends ProtobufEnum> static method

Map<int, T> initByValue<T extends ProtobufEnum>(
  1. List<T> byIndex
)

Creates a Map for all of the ProtobufEnums in byIndex, mapping each ProtobufEnum's value to the ProtobufEnum.

Implementation

static Map<int, T> initByValue<T extends ProtobufEnum>(List<T> byIndex) {
  final byValue = <int, T>{};
  for (final v in byIndex) {
    byValue[v.value] = v;
  }
  return byValue;
}