protobufEnumByIndex<P extends ProtobufEnum, E extends Enum> static method

BiDi<P, E> protobufEnumByIndex<P extends ProtobufEnum, E extends Enum>(
  1. List<P> pbValues,
  2. List<E> enumValues
)

Implementation

static BiDi<P, E> protobufEnumByIndex<P extends ProtobufEnum, E extends Enum>(
    List<P> pbValues,
    List<E> enumValues,
    ) {
  assert(pbValues.length == enumValues.length);

  return BiDi(
    forward: (pb) => enumValues[pb.value],
    backward: (enm) => pbValues[enm.index],
  );
}