toState method

State toState()

Implementation

State toState() {
  switch (this) {
    case 'OFFLINE':
      return State.offline;
    case 'ONLINE':
      return State.online;
    case 'STARTING':
      return State.starting;
    case 'STOPPING':
      return State.stopping;
    case 'START_FAILED':
      return State.startFailed;
    case 'STOP_FAILED':
      return State.stopFailed;
  }
  throw Exception('$this is not known in enum State');
}