Ydb.Topic.Codec
*/
class Codec
{
/**
* Generated from protobuf enum CODEC_UNSPECIFIED = 0;
*/
const CODEC_UNSPECIFIED = 0;
/**
* Generated from protobuf enum CODEC_RAW = 1;
*/
const CODEC_RAW = 1;
/**
* Generated from protobuf enum CODEC_GZIP = 2;
*/
const CODEC_GZIP = 2;
/**
* Generated from protobuf enum CODEC_LZOP = 3;
*/
const CODEC_LZOP = 3;
/**
* Generated from protobuf enum CODEC_ZSTD = 4;
*/
const CODEC_ZSTD = 4;
/**
* User-defined codecs from 10000 to 19999
*
* Generated from protobuf enum CODEC_CUSTOM = 10000;
*/
const CODEC_CUSTOM = 10000;
private static $valueToName = [
self::CODEC_UNSPECIFIED => 'CODEC_UNSPECIFIED',
self::CODEC_RAW => 'CODEC_RAW',
self::CODEC_GZIP => 'CODEC_GZIP',
self::CODEC_LZOP => 'CODEC_LZOP',
self::CODEC_ZSTD => 'CODEC_ZSTD',
self::CODEC_CUSTOM => 'CODEC_CUSTOM',
];
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);
}
}