<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: testPattern.proto

namespace Rv\Data\TestPatternDefinition\DoubleProperty;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.TestPatternDefinition.DoubleProperty.ViewType</code>
 */
class ViewType
{
    /**
     * Generated from protobuf enum <code>VIEW_TYPE_STEPPER = 0;</code>
     */
    const VIEW_TYPE_STEPPER = 0;
    /**
     * Generated from protobuf enum <code>VIEW_TYPE_SLIDER = 1;</code>
     */
    const VIEW_TYPE_SLIDER = 1;
    /**
     * Generated from protobuf enum <code>VIEW_TYPE_SPEED_SLIDER = 2;</code>
     */
    const VIEW_TYPE_SPEED_SLIDER = 2;

    private static $valueToName = [
        self::VIEW_TYPE_STEPPER => 'VIEW_TYPE_STEPPER',
        self::VIEW_TYPE_SLIDER => 'VIEW_TYPE_SLIDER',
        self::VIEW_TYPE_SPEED_SLIDER => 'VIEW_TYPE_SPEED_SLIDER',
    ];

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

