<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/vision/v1/text_annotation.proto

namespace Google\Cloud\Vision\V1\TextAnnotation\DetectedBreak;

use UnexpectedValueException;

/**
 * Enum to denote the type of break found. New line, space etc.
 *
 * Protobuf type <code>google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType</code>
 */
class BreakType
{
    /**
     * Unknown break label type.
     *
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Regular space.
     *
     * Generated from protobuf enum <code>SPACE = 1;</code>
     */
    const SPACE = 1;
    /**
     * Sure space (very wide).
     *
     * Generated from protobuf enum <code>SURE_SPACE = 2;</code>
     */
    const SURE_SPACE = 2;
    /**
     * Line-wrapping break.
     *
     * Generated from protobuf enum <code>EOL_SURE_SPACE = 3;</code>
     */
    const EOL_SURE_SPACE = 3;
    /**
     * End-line hyphen that is not present in text; does not co-occur with
     * `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
     *
     * Generated from protobuf enum <code>HYPHEN = 4;</code>
     */
    const HYPHEN = 4;
    /**
     * Line break that ends a paragraph.
     *
     * Generated from protobuf enum <code>LINE_BREAK = 5;</code>
     */
    const LINE_BREAK = 5;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::SPACE => 'SPACE',
        self::SURE_SPACE => 'SURE_SPACE',
        self::EOL_SURE_SPACE => 'EOL_SURE_SPACE',
        self::HYPHEN => 'HYPHEN',
        self::LINE_BREAK => 'LINE_BREAK',
    ];

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


