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

namespace Google\Cloud\Dlp\V2;

use UnexpectedValueException;

/**
 * Bucketized nullness percentage levels. A higher level means a higher
 * percentage of the column is null.
 *
 * Protobuf type <code>google.privacy.dlp.v2.NullPercentageLevel</code>
 */
class NullPercentageLevel
{
    /**
     * Unused.
     *
     * Generated from protobuf enum <code>NULL_PERCENTAGE_LEVEL_UNSPECIFIED = 0;</code>
     */
    const NULL_PERCENTAGE_LEVEL_UNSPECIFIED = 0;
    /**
     * Very few null entries.
     *
     * Generated from protobuf enum <code>NULL_PERCENTAGE_VERY_LOW = 1;</code>
     */
    const NULL_PERCENTAGE_VERY_LOW = 1;
    /**
     * Some null entries.
     *
     * Generated from protobuf enum <code>NULL_PERCENTAGE_LOW = 2;</code>
     */
    const NULL_PERCENTAGE_LOW = 2;
    /**
     * A few null entries.
     *
     * Generated from protobuf enum <code>NULL_PERCENTAGE_MEDIUM = 3;</code>
     */
    const NULL_PERCENTAGE_MEDIUM = 3;
    /**
     * A lot of null entries.
     *
     * Generated from protobuf enum <code>NULL_PERCENTAGE_HIGH = 4;</code>
     */
    const NULL_PERCENTAGE_HIGH = 4;

    private static $valueToName = [
        self::NULL_PERCENTAGE_LEVEL_UNSPECIFIED => 'NULL_PERCENTAGE_LEVEL_UNSPECIFIED',
        self::NULL_PERCENTAGE_VERY_LOW => 'NULL_PERCENTAGE_VERY_LOW',
        self::NULL_PERCENTAGE_LOW => 'NULL_PERCENTAGE_LOW',
        self::NULL_PERCENTAGE_MEDIUM => 'NULL_PERCENTAGE_MEDIUM',
        self::NULL_PERCENTAGE_HIGH => 'NULL_PERCENTAGE_HIGH',
    ];

    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);
    }
}

