2.13.2 (latest) 2.13.1 2.12.3 2.11.1 2.10.2 2.9.1 2.8.0 2.7.1 2.6.5 Reference documentation and code samples for the Cloud Bigtable API class Google::Cloud::Bigtable::RowFilter::ConditionFilter.

## ConditionFilter

A RowFilter that evaluates one of two possible RowFilters, depending on
whether or not a predicate RowFilter outputs any cells from the input row.

IMPORTANT NOTE: The predicate filter does not execute atomically with the
true and false filters, which may lead to inconsistent or unexpected
results. Additionally, condition filters have poor performance, especially
when filters are set for the false condition.

If `predicate_filter` outputs any cells, then `true_filter` will be
evaluated on the input row. Otherwise, `false_filter` will be evaluated.

## Inherits

- Object

## Example

```ruby
predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"

label = Google::Cloud::Bigtable::RowFilter.label "user"
strip_value = Google::Cloud::Bigtable::RowFilter.strip_value

Google::Cloud::Bigtable::RowFilter.condition(predicate).on_match(label).otherwise(strip_value)
```

## Methods

### #on_match

```ruby
def on_match(filter) -> Google::Cloud::Bigtable::RowFilter::ConditionFilter
```
Sets a true filter on predicate-filter match.


<br />

The filter to apply to the input row if `predicate_filter` returns any
results. If not provided, no results will be returned in the true case.
**Parameter**

- **filter** ([SimpleFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-SimpleFilter.md.txt), [ChainFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-ChainFilter.md.txt), [InterleaveFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-InterleaveFilter.md.txt), [ConditionFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-ConditionFilter.md.txt))
**Returns**

- ([Google::Cloud::Bigtable::RowFilter::ConditionFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-ConditionFilter.md.txt))
**Example**

```ruby
require "google/cloud/bigtable"
predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"

label = Google::Cloud::Bigtable::RowFilter.label "user"
strip_value = Google::Cloud::Bigtable::RowFilter.strip_value

Google::Cloud::Bigtable::RowFilter.condition(predicate).on_match(label).otherwise(strip_value)
```

### #otherwise

```ruby
def otherwise(filter) -> Google::Cloud::Bigtable::RowFilter::ConditionFilter
```
Set otherwise(false) filter.


<br />

The filter to apply to the input row if `predicate_filter` does not
return any results. If not provided, no results will be returned in the
false case.
**Parameter**

- **filter** ([SimpleFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-SimpleFilter.md.txt), [ChainFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-ChainFilter.md.txt), [InterleaveFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-InterleaveFilter.md.txt), [ConditionFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-ConditionFilter.md.txt))
**Returns**

- ([Google::Cloud::Bigtable::RowFilter::ConditionFilter](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-bigtable/latest/Google-Cloud-Bigtable-RowFilter-ConditionFilter.md.txt))
**Example**

```ruby
require "google/cloud/bigtable"

predicate = Google::Cloud::Bigtable::RowFilter.key "user-*"

label = Google::Cloud::Bigtable::RowFilter.label "user"
strip_value = Google::Cloud::Bigtable::RowFilter.strip_value

Google::Cloud::Bigtable::RowFilter.condition(predicate).on_match(label).otherwise(strip_value)
```