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

namespace OS\PB;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.CodeHopButtonMask</code>
 */
class CodeHopButtonMask
{
    /**
     * Generated from protobuf enum <code>CodeHopButton_NotSet = 0;</code>
     */
    const CodeHopButton_NotSet = 0;
    /**
     * Generated from protobuf enum <code>CodeHopButton_Red = 1;</code>
     */
    const CodeHopButton_Red = 1;
    /**
     * Generated from protobuf enum <code>CodeHopButton_White = 2;</code>
     */
    const CodeHopButton_White = 2;
    /**
     * Generated from protobuf enum <code>CodeHopButton_Blue = 4;</code>
     */
    const CodeHopButton_Blue = 4;
    /**
     * Generated from protobuf enum <code>CodeHopButton_Green = 8;</code>
     */
    const CodeHopButton_Green = 8;
    /**
     * Generated from protobuf enum <code>CodeHopButton_Black = 16;</code>
     */
    const CodeHopButton_Black = 16;
    /**
     * Generated from protobuf enum <code>CodeHopButton_Yellow = 32;</code>
     */
    const CodeHopButton_Yellow = 32;
    /**
     * Generated from protobuf enum <code>CodeHopButton_Grey = 64;</code>
     */
    const CodeHopButton_Grey = 64;

    private static $valueToName = [
        self::CodeHopButton_NotSet => 'CodeHopButton_NotSet',
        self::CodeHopButton_Red => 'CodeHopButton_Red',
        self::CodeHopButton_White => 'CodeHopButton_White',
        self::CodeHopButton_Blue => 'CodeHopButton_Blue',
        self::CodeHopButton_Green => 'CodeHopButton_Green',
        self::CodeHopButton_Black => 'CodeHopButton_Black',
        self::CodeHopButton_Yellow => 'CodeHopButton_Yellow',
        self::CodeHopButton_Grey => 'CodeHopButton_Grey',
    ];

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

