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

namespace Rv\Data\Media\VideoProperties;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.Media.VideoProperties.EndBehavior</code>
 */
class EndBehavior
{
    /**
     * Generated from protobuf enum <code>END_BEHAVIOR_STOP = 0;</code>
     */
    const END_BEHAVIOR_STOP = 0;
    /**
     * Generated from protobuf enum <code>END_BEHAVIOR_STOP_ON_BLACK = 1;</code>
     */
    const END_BEHAVIOR_STOP_ON_BLACK = 1;
    /**
     * Generated from protobuf enum <code>END_BEHAVIOR_STOP_ON_CLEAR = 2;</code>
     */
    const END_BEHAVIOR_STOP_ON_CLEAR = 2;
    /**
     * Generated from protobuf enum <code>END_BEHAVIOR_FADE_TO_BLACK = 3;</code>
     */
    const END_BEHAVIOR_FADE_TO_BLACK = 3;
    /**
     * Generated from protobuf enum <code>END_BEHAVIOR_FADE_TO_CLEAR = 4;</code>
     */
    const END_BEHAVIOR_FADE_TO_CLEAR = 4;

    private static $valueToName = [
        self::END_BEHAVIOR_STOP => 'END_BEHAVIOR_STOP',
        self::END_BEHAVIOR_STOP_ON_BLACK => 'END_BEHAVIOR_STOP_ON_BLACK',
        self::END_BEHAVIOR_STOP_ON_CLEAR => 'END_BEHAVIOR_STOP_ON_CLEAR',
        self::END_BEHAVIOR_FADE_TO_BLACK => 'END_BEHAVIOR_FADE_TO_BLACK',
        self::END_BEHAVIOR_FADE_TO_CLEAR => 'END_BEHAVIOR_FADE_TO_CLEAR',
    ];

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

