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

namespace Google\Cloud\Dataplex\V1\DataQualityRule\StatisticRangeExpectation;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.dataplex.v1.DataQualityRule.StatisticRangeExpectation.ColumnStatistic</code>
 */
class ColumnStatistic
{
    /**
     * Unspecified statistic type
     *
     * Generated from protobuf enum <code>STATISTIC_UNDEFINED = 0;</code>
     */
    const STATISTIC_UNDEFINED = 0;
    /**
     * Evaluate the column mean
     *
     * Generated from protobuf enum <code>MEAN = 1;</code>
     */
    const MEAN = 1;
    /**
     * Evaluate the column min
     *
     * Generated from protobuf enum <code>MIN = 2;</code>
     */
    const MIN = 2;
    /**
     * Evaluate the column max
     *
     * Generated from protobuf enum <code>MAX = 3;</code>
     */
    const MAX = 3;

    private static $valueToName = [
        self::STATISTIC_UNDEFINED => 'STATISTIC_UNDEFINED',
        self::MEAN => 'MEAN',
        self::MIN => 'MIN',
        self::MAX => 'MAX',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


