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

namespace Rv\Data\Graphics\Path\Shape;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.Graphics.Path.Shape.Type</code>
 */
class Type
{
    /**
     * Generated from protobuf enum <code>TYPE_UNKNOWN = 0;</code>
     */
    const TYPE_UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>TYPE_RECTANGLE = 1;</code>
     */
    const TYPE_RECTANGLE = 1;
    /**
     * Generated from protobuf enum <code>TYPE_ELLIPSE = 2;</code>
     */
    const TYPE_ELLIPSE = 2;
    /**
     * Generated from protobuf enum <code>TYPE_ISOSCELES_TRIANGLE = 3;</code>
     */
    const TYPE_ISOSCELES_TRIANGLE = 3;
    /**
     * Generated from protobuf enum <code>TYPE_RIGHT_TRIANGLE = 4;</code>
     */
    const TYPE_RIGHT_TRIANGLE = 4;
    /**
     * Generated from protobuf enum <code>TYPE_RHOMBUS = 5;</code>
     */
    const TYPE_RHOMBUS = 5;
    /**
     * Generated from protobuf enum <code>TYPE_STAR = 6;</code>
     */
    const TYPE_STAR = 6;
    /**
     * Generated from protobuf enum <code>TYPE_POLYGON = 7;</code>
     */
    const TYPE_POLYGON = 7;
    /**
     * Generated from protobuf enum <code>TYPE_CUSTOM = 8;</code>
     */
    const TYPE_CUSTOM = 8;
    /**
     * Generated from protobuf enum <code>TYPE_RIGHT_ARROW = 9;</code>
     */
    const TYPE_RIGHT_ARROW = 9;
    /**
     * Generated from protobuf enum <code>TYPE_DOUBLE_ARROW = 10;</code>
     */
    const TYPE_DOUBLE_ARROW = 10;
    /**
     * Generated from protobuf enum <code>TYPE_ROUNDED_RECTANGLE = 11;</code>
     */
    const TYPE_ROUNDED_RECTANGLE = 11;

    private static $valueToName = [
        self::TYPE_UNKNOWN => 'TYPE_UNKNOWN',
        self::TYPE_RECTANGLE => 'TYPE_RECTANGLE',
        self::TYPE_ELLIPSE => 'TYPE_ELLIPSE',
        self::TYPE_ISOSCELES_TRIANGLE => 'TYPE_ISOSCELES_TRIANGLE',
        self::TYPE_RIGHT_TRIANGLE => 'TYPE_RIGHT_TRIANGLE',
        self::TYPE_RHOMBUS => 'TYPE_RHOMBUS',
        self::TYPE_STAR => 'TYPE_STAR',
        self::TYPE_POLYGON => 'TYPE_POLYGON',
        self::TYPE_CUSTOM => 'TYPE_CUSTOM',
        self::TYPE_RIGHT_ARROW => 'TYPE_RIGHT_ARROW',
        self::TYPE_DOUBLE_ARROW => 'TYPE_DOUBLE_ARROW',
        self::TYPE_ROUNDED_RECTANGLE => 'TYPE_ROUNDED_RECTANGLE',
    ];

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

