toPeriodUnit method

PeriodUnit toPeriodUnit()

Implementation

PeriodUnit toPeriodUnit() {
  switch (this) {
    case 'MICROSECOND':
      return PeriodUnit.microsecond;
    case 'MILLISECOND':
      return PeriodUnit.millisecond;
    case 'SECOND':
      return PeriodUnit.second;
    case 'MINUTE':
      return PeriodUnit.minute;
    case 'HOUR':
      return PeriodUnit.hour;
    case 'DAY':
      return PeriodUnit.day;
    case 'WEEK':
      return PeriodUnit.week;
  }
  throw Exception('$this is not known in enum PeriodUnit');
}