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

namespace Rv\Data\Graphics\Text\Attributes;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.Graphics.Text.Attributes.Alignment</code>
 */
class Alignment
{
    /**
     * Generated from protobuf enum <code>ALIGNMENT_LEFT = 0;</code>
     */
    const ALIGNMENT_LEFT = 0;
    /**
     * Generated from protobuf enum <code>ALIGNMENT_RIGHT = 1;</code>
     */
    const ALIGNMENT_RIGHT = 1;
    /**
     * Generated from protobuf enum <code>ALIGNMENT_CENTER = 2;</code>
     */
    const ALIGNMENT_CENTER = 2;
    /**
     * Generated from protobuf enum <code>ALIGNMENT_JUSTIFIED = 3;</code>
     */
    const ALIGNMENT_JUSTIFIED = 3;
    /**
     * Generated from protobuf enum <code>ALIGNMENT_NATURAL = 4;</code>
     */
    const ALIGNMENT_NATURAL = 4;

    private static $valueToName = [
        self::ALIGNMENT_LEFT => 'ALIGNMENT_LEFT',
        self::ALIGNMENT_RIGHT => 'ALIGNMENT_RIGHT',
        self::ALIGNMENT_CENTER => 'ALIGNMENT_CENTER',
        self::ALIGNMENT_JUSTIFIED => 'ALIGNMENT_JUSTIFIED',
        self::ALIGNMENT_NATURAL => 'ALIGNMENT_NATURAL',
    ];

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

