<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: couchbase/internal/hooks/v1/hooks.proto

namespace Couchbase\Protostellar\Generated\Internal\Hooks\V1;

use UnexpectedValueException;

/**
 * Protobuf type <code>couchbase.internal.hooks.v1.ComparisonOperator</code>
 */
class ComparisonOperator
{
    /**
     * Generated from protobuf enum <code>COMPARISON_OPERATOR_EQUAL = 0;</code>
     */
    const COMPARISON_OPERATOR_EQUAL = 0;
    /**
     * Generated from protobuf enum <code>COMPARISON_OPERATOR_NOT_EQUAL = 1;</code>
     */
    const COMPARISON_OPERATOR_NOT_EQUAL = 1;
    /**
     * Generated from protobuf enum <code>COMPARISON_OPERATOR_GREATER_THAN = 2;</code>
     */
    const COMPARISON_OPERATOR_GREATER_THAN = 2;
    /**
     * Generated from protobuf enum <code>COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL = 3;</code>
     */
    const COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL = 3;
    /**
     * Generated from protobuf enum <code>COMPARISON_OPERATOR_LESS_THAN = 4;</code>
     */
    const COMPARISON_OPERATOR_LESS_THAN = 4;
    /**
     * Generated from protobuf enum <code>COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL = 5;</code>
     */
    const COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL = 5;

    private static $valueToName = [
        self::COMPARISON_OPERATOR_EQUAL => 'COMPARISON_OPERATOR_EQUAL',
        self::COMPARISON_OPERATOR_NOT_EQUAL => 'COMPARISON_OPERATOR_NOT_EQUAL',
        self::COMPARISON_OPERATOR_GREATER_THAN => 'COMPARISON_OPERATOR_GREATER_THAN',
        self::COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL => 'COMPARISON_OPERATOR_GREATER_THAN_OR_EQUAL',
        self::COMPARISON_OPERATOR_LESS_THAN => 'COMPARISON_OPERATOR_LESS_THAN',
        self::COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL => 'COMPARISON_OPERATOR_LESS_THAN_OR_EQUAL',
    ];

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

