toInternal method

Maps the external BlockThreshold enum to the internal HarmBlockThreshold enum.

Implementation

InternalHarmBlockThreshold toInternal() {
  switch (this) {
    case public_types.BlockThreshold.NONE:
      return InternalHarmBlockThreshold.BLOCK_NONE;
    case public_types.BlockThreshold.ONLY_HIGH:
      return InternalHarmBlockThreshold.BLOCK_ONLY_HIGH;
    case public_types.BlockThreshold.MEDIUM_AND_ABOVE:
      return InternalHarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE;
    case public_types.BlockThreshold.LOW_AND_ABOVE:
      return InternalHarmBlockThreshold.BLOCK_LOW_AND_ABOVE;
    case public_types.BlockThreshold.UNSPECIFIED:
      return InternalHarmBlockThreshold.UNSPECIFIED;
  }
}