when method

void when({
  1. required void onBooleanValue(
    1. SearchFeatureBooleanValue value
    ),
  2. required void onVectorString(
    1. List<String> value
    ),
  3. required void onVectorEnumValue(
    1. List<SearchFeatureEnumValue> value
    ),
})

Applies the passed function to the variant value.

Implementation

void when({
  required void Function(SearchFeatureBooleanValue value) onBooleanValue,
  required void Function(core.List<core.String> value) onVectorString,
  required void Function(core.List<SearchFeatureEnumValue> value)
      onVectorEnumValue,
}) {
  if (_value is SearchFeatureBooleanValue) {
    return onBooleanValue(_value as SearchFeatureBooleanValue);
  }
  if (_value is core.List<core.String>) {
    return onVectorString(_value as core.List<core.String>);
  }
  if (_value is core.List<SearchFeatureEnumValue>) {
    return onVectorEnumValue(_value as core.List<SearchFeatureEnumValue>);
  }
  assert(false);
}