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

namespace Rv\Analytics\Trigger\Cue\SlideScrollingTextElement;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.analytics.trigger.cue.SlideScrollingTextElement.Speed</code>
 */
class Speed
{
    /**
     * Generated from protobuf enum <code>SPEED_UNKNOWN = 0;</code>
     */
    const SPEED_UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>VERY_SLOW = 1;</code>
     */
    const VERY_SLOW = 1;
    /**
     * Generated from protobuf enum <code>SLOW = 2;</code>
     */
    const SLOW = 2;
    /**
     * Generated from protobuf enum <code>MEDIUM = 3;</code>
     */
    const MEDIUM = 3;
    /**
     * Generated from protobuf enum <code>FAST = 4;</code>
     */
    const FAST = 4;
    /**
     * Generated from protobuf enum <code>VERY_FAST = 5;</code>
     */
    const VERY_FAST = 5;

    private static $valueToName = [
        self::SPEED_UNKNOWN => 'SPEED_UNKNOWN',
        self::VERY_SLOW => 'VERY_SLOW',
        self::SLOW => 'SLOW',
        self::MEDIUM => 'MEDIUM',
        self::FAST => 'FAST',
        self::VERY_FAST => 'VERY_FAST',
    ];

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

