google.protobuf.FileOptions.OptimizeMode
*/
class OptimizeMode
{
/**
* Generate complete code for parsing, serialization,
*
* Generated from protobuf enum SPEED = 1;
*/
const SPEED = 1;
/**
* etc.
*
* Generated from protobuf enum CODE_SIZE = 2;
*/
const CODE_SIZE = 2;
/**
* Generate code using MessageLite and the lite runtime.
*
* Generated from protobuf enum LITE_RUNTIME = 3;
*/
const LITE_RUNTIME = 3;
private static $valueToName = [
self::SPEED => 'SPEED',
self::CODE_SIZE => 'CODE_SIZE',
self::LITE_RUNTIME => 'LITE_RUNTIME',
];
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);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(OptimizeMode::class, \Google\Protobuf\Internal\FileOptions_OptimizeMode::class);