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

namespace Rv\Data\CopyrightLayout;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.CopyrightLayout.TokenType</code>
 */
class TokenType
{
    /**
     * Generated from protobuf enum <code>Text = 0;</code>
     */
    const Text = 0;
    /**
     * Generated from protobuf enum <code>Artist = 1;</code>
     */
    const Artist = 1;
    /**
     * Generated from protobuf enum <code>Author = 2;</code>
     */
    const Author = 2;
    /**
     * Generated from protobuf enum <code>Publisher = 3;</code>
     */
    const Publisher = 3;
    /**
     * Generated from protobuf enum <code>Title = 4;</code>
     */
    const Title = 4;
    /**
     * Generated from protobuf enum <code>CopyrightYear = 5;</code>
     */
    const CopyrightYear = 5;
    /**
     * Generated from protobuf enum <code>LicenseNumber = 6;</code>
     */
    const LicenseNumber = 6;
    /**
     * Generated from protobuf enum <code>SongNumber = 7;</code>
     */
    const SongNumber = 7;

    private static $valueToName = [
        self::Text => 'Text',
        self::Artist => 'Artist',
        self::Author => 'Author',
        self::Publisher => 'Publisher',
        self::Title => 'Title',
        self::CopyrightYear => 'CopyrightYear',
        self::LicenseNumber => 'LicenseNumber',
        self::SongNumber => 'SongNumber',
    ];

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

