<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dataplex/v1/data_profile.proto

namespace Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field;

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

/**
 * ProfileInfo defines the profile information for each schema field type.
 *
 * Generated from protobuf message <code>google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo</code>
 */
class ProfileInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The ratio of null rows against the rows in the sampled data.
     *
     * Generated from protobuf field <code>double null_ratio = 2;</code>
     */
    private $null_ratio = 0.0;
    /**
     * The ratio of rows that are distinct against the rows in the sampled
     * data.
     *
     * Generated from protobuf field <code>double distinct_ratio = 3;</code>
     */
    private $distinct_ratio = 0.0;
    /**
     * The array of top N values of the field in the sampled data.
     * Currently N is set as 10 or equal to distinct values in the field,
     * whichever is smaller. This will be optional for complex non-groupable
     * data-types such as JSON, ARRAY, JSON, STRUCT.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.TopNValue top_n_values = 4;</code>
     */
    private $top_n_values;
    protected $field_info;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $null_ratio
     *           The ratio of null rows against the rows in the sampled data.
     *     @type float $distinct_ratio
     *           The ratio of rows that are distinct against the rows in the sampled
     *           data.
     *     @type array<\Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\TopNValue>|\Google\Protobuf\Internal\RepeatedField $top_n_values
     *           The array of top N values of the field in the sampled data.
     *           Currently N is set as 10 or equal to distinct values in the field,
     *           whichever is smaller. This will be optional for complex non-groupable
     *           data-types such as JSON, ARRAY, JSON, STRUCT.
     *     @type \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\StringFieldInfo $string_profile
     *           The corresponding string field profile.
     *     @type \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\IntegerFieldInfo $integer_profile
     *           The corresponding integer field profile.
     *     @type \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\DoubleFieldInfo $double_profile
     *           The corresponding double field profile.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataplex\V1\DataProfile::initOnce();
        parent::__construct($data);
    }

    /**
     * The ratio of null rows against the rows in the sampled data.
     *
     * Generated from protobuf field <code>double null_ratio = 2;</code>
     * @return float
     */
    public function getNullRatio()
    {
        return $this->null_ratio;
    }

    /**
     * The ratio of null rows against the rows in the sampled data.
     *
     * Generated from protobuf field <code>double null_ratio = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setNullRatio($var)
    {
        GPBUtil::checkDouble($var);
        $this->null_ratio = $var;

        return $this;
    }

    /**
     * The ratio of rows that are distinct against the rows in the sampled
     * data.
     *
     * Generated from protobuf field <code>double distinct_ratio = 3;</code>
     * @return float
     */
    public function getDistinctRatio()
    {
        return $this->distinct_ratio;
    }

    /**
     * The ratio of rows that are distinct against the rows in the sampled
     * data.
     *
     * Generated from protobuf field <code>double distinct_ratio = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setDistinctRatio($var)
    {
        GPBUtil::checkDouble($var);
        $this->distinct_ratio = $var;

        return $this;
    }

    /**
     * The array of top N values of the field in the sampled data.
     * Currently N is set as 10 or equal to distinct values in the field,
     * whichever is smaller. This will be optional for complex non-groupable
     * data-types such as JSON, ARRAY, JSON, STRUCT.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.TopNValue top_n_values = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTopNValues()
    {
        return $this->top_n_values;
    }

    /**
     * The array of top N values of the field in the sampled data.
     * Currently N is set as 10 or equal to distinct values in the field,
     * whichever is smaller. This will be optional for complex non-groupable
     * data-types such as JSON, ARRAY, JSON, STRUCT.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.TopNValue top_n_values = 4;</code>
     * @param array<\Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\TopNValue>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTopNValues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\TopNValue::class);
        $this->top_n_values = $arr;

        return $this;
    }

    /**
     * The corresponding string field profile.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.StringFieldInfo string_profile = 101;</code>
     * @return \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\StringFieldInfo|null
     */
    public function getStringProfile()
    {
        return $this->readOneof(101);
    }

    public function hasStringProfile()
    {
        return $this->hasOneof(101);
    }

    /**
     * The corresponding string field profile.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.StringFieldInfo string_profile = 101;</code>
     * @param \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\StringFieldInfo $var
     * @return $this
     */
    public function setStringProfile($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\StringFieldInfo::class);
        $this->writeOneof(101, $var);

        return $this;
    }

    /**
     * The corresponding integer field profile.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.IntegerFieldInfo integer_profile = 102;</code>
     * @return \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\IntegerFieldInfo|null
     */
    public function getIntegerProfile()
    {
        return $this->readOneof(102);
    }

    public function hasIntegerProfile()
    {
        return $this->hasOneof(102);
    }

    /**
     * The corresponding integer field profile.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.IntegerFieldInfo integer_profile = 102;</code>
     * @param \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\IntegerFieldInfo $var
     * @return $this
     */
    public function setIntegerProfile($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\IntegerFieldInfo::class);
        $this->writeOneof(102, $var);

        return $this;
    }

    /**
     * The corresponding double field profile.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.DoubleFieldInfo double_profile = 103;</code>
     * @return \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\DoubleFieldInfo|null
     */
    public function getDoubleProfile()
    {
        return $this->readOneof(103);
    }

    public function hasDoubleProfile()
    {
        return $this->hasOneof(103);
    }

    /**
     * The corresponding double field profile.
     *
     * Generated from protobuf field <code>.google.cloud.dataplex.v1.DataProfileResult.Profile.Field.ProfileInfo.DoubleFieldInfo double_profile = 103;</code>
     * @param \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\DoubleFieldInfo $var
     * @return $this
     */
    public function setDoubleProfile($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataplex\V1\DataProfileResult\Profile\Field\ProfileInfo\DoubleFieldInfo::class);
        $this->writeOneof(103, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getFieldInfo()
    {
        return $this->whichOneof("field_info");
    }

}


