<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/v2/data.proto

namespace Google\Cloud\Bigtable\V2\RowFilter;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A RowFilter which 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.
 *
 * Generated from protobuf message <code>google.bigtable.v2.RowFilter.Condition</code>
 */
class Condition extends \Google\Protobuf\Internal\Message
{
    /**
     * If `predicate_filter` outputs any cells, then `true_filter` will be
     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter predicate_filter = 1;</code>
     */
    protected $predicate_filter = null;
    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter true_filter = 2;</code>
     */
    protected $true_filter = null;
    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter false_filter = 3;</code>
     */
    protected $false_filter = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Bigtable\V2\RowFilter $predicate_filter
     *           If `predicate_filter` outputs any cells, then `true_filter` will be
     *           evaluated on the input row. Otherwise, `false_filter` will be evaluated.
     *     @type \Google\Cloud\Bigtable\V2\RowFilter $true_filter
     *           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.
     *     @type \Google\Cloud\Bigtable\V2\RowFilter $false_filter
     *           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.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * If `predicate_filter` outputs any cells, then `true_filter` will be
     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter predicate_filter = 1;</code>
     * @return \Google\Cloud\Bigtable\V2\RowFilter|null
     */
    public function getPredicateFilter()
    {
        return $this->predicate_filter;
    }

    public function hasPredicateFilter()
    {
        return isset($this->predicate_filter);
    }

    public function clearPredicateFilter()
    {
        unset($this->predicate_filter);
    }

    /**
     * If `predicate_filter` outputs any cells, then `true_filter` will be
     * evaluated on the input row. Otherwise, `false_filter` will be evaluated.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter predicate_filter = 1;</code>
     * @param \Google\Cloud\Bigtable\V2\RowFilter $var
     * @return $this
     */
    public function setPredicateFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class);
        $this->predicate_filter = $var;

        return $this;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter true_filter = 2;</code>
     * @return \Google\Cloud\Bigtable\V2\RowFilter|null
     */
    public function getTrueFilter()
    {
        return $this->true_filter;
    }

    public function hasTrueFilter()
    {
        return isset($this->true_filter);
    }

    public function clearTrueFilter()
    {
        unset($this->true_filter);
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter true_filter = 2;</code>
     * @param \Google\Cloud\Bigtable\V2\RowFilter $var
     * @return $this
     */
    public function setTrueFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class);
        $this->true_filter = $var;

        return $this;
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter false_filter = 3;</code>
     * @return \Google\Cloud\Bigtable\V2\RowFilter|null
     */
    public function getFalseFilter()
    {
        return $this->false_filter;
    }

    public function hasFalseFilter()
    {
        return isset($this->false_filter);
    }

    public function clearFalseFilter()
    {
        unset($this->false_filter);
    }

    /**
     * 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.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RowFilter false_filter = 3;</code>
     * @param \Google\Cloud\Bigtable\V2\RowFilter $var
     * @return $this
     */
    public function setFalseFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RowFilter::class);
        $this->false_filter = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Condition::class, \Google\Cloud\Bigtable\V2\RowFilter_Condition::class);

