GetSearchFilterInstance static method

SearchFilter? GetSearchFilterInstance(
  1. String localName
)
Gets the search filter instance. Name of the local.

Implementation

/* private */
static SearchFilter? GetSearchFilterInstance(String localName) {
  SearchFilter? searchFilter;
  switch (localName) {
    case XmlElementNames.Exists:
      searchFilter = new Exists();
      break;
    case XmlElementNames.Contains:
      searchFilter = new ContainsSubString();
      break;
    case XmlElementNames.Excludes:
      searchFilter = new ExcludesBitmask();
      break;
    case XmlElementNames.Not:
      searchFilter = new Not();
      break;
    case XmlElementNames.And:
      searchFilter =
          new SearchFilterCollection.withOperator(LogicalOperator.And);
      break;
    case XmlElementNames.Or:
      searchFilter =
          new SearchFilterCollection.withOperator(LogicalOperator.Or);
      break;
    case XmlElementNames.IsEqualTo:
      searchFilter = new IsEqualTo();
      break;
    case XmlElementNames.IsNotEqualTo:
      searchFilter = new IsNotEqualTo();
      break;
    case XmlElementNames.IsGreaterThan:
      searchFilter = new IsGreaterThan();
      break;
    case XmlElementNames.IsGreaterThanOrEqualTo:
      searchFilter = new IsGreaterThanOrEqualTo();
      break;
    case XmlElementNames.IsLessThan:
      searchFilter = new IsLessThan();
      break;
    case XmlElementNames.IsLessThanOrEqualTo:
      searchFilter = new IsLessThanOrEqualTo();
      break;
    default:
      searchFilter = null;
      break;
  }
  return searchFilter;
}