ClassificationProperty.fromCrawledProperty constructor

ClassificationProperty.fromCrawledProperty(
  1. CrawledProperty property
)

Implementation

factory ClassificationProperty.fromCrawledProperty(CrawledProperty property) {
  assert(
    property.name.toUpperCase() == "CLASS",
    "Received invalid property: ${property.name}",
  );

  return ClassificationProperty(
    ClassificationType.values.firstWhere(
      (element) =>
          element.value.toUpperCase() ==
          TextValue.fromCrawledStringValue(property.value)
              .value
              .toUpperCase(),
    ),
  );
}