toEntityType method

EntityType toEntityType()

Implementation

EntityType toEntityType() {
  switch (this) {
    case 'PERSON':
      return EntityType.person;
    case 'LOCATION':
      return EntityType.location;
    case 'ORGANIZATION':
      return EntityType.organization;
    case 'COMMERCIAL_ITEM':
      return EntityType.commercialItem;
    case 'EVENT':
      return EntityType.event;
    case 'DATE':
      return EntityType.date;
    case 'QUANTITY':
      return EntityType.quantity;
    case 'TITLE':
      return EntityType.title;
    case 'OTHER':
      return EntityType.other;
  }
  throw Exception('$this is not known in enum EntityType');
}