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

namespace Rv\Data\MediaMetadataRequestInfo;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.MediaMetadataRequestInfo.BufferFormat</code>
 */
class BufferFormat
{
    /**
     * Generated from protobuf enum <code>BUFFER_FORMAT_RAW = 0;</code>
     */
    const BUFFER_FORMAT_RAW = 0;
    /**
     * Generated from protobuf enum <code>BUFFER_FORMAT_PNG = 1;</code>
     */
    const BUFFER_FORMAT_PNG = 1;
    /**
     * Generated from protobuf enum <code>BUFFER_FORMAT_NONE = 2;</code>
     */
    const BUFFER_FORMAT_NONE = 2;

    private static $valueToName = [
        self::BUFFER_FORMAT_RAW => 'BUFFER_FORMAT_RAW',
        self::BUFFER_FORMAT_PNG => 'BUFFER_FORMAT_PNG',
        self::BUFFER_FORMAT_NONE => 'BUFFER_FORMAT_NONE',
    ];

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

