<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: src/proto/grpc/core/stats.proto

namespace Grpc\Core;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Generated from protobuf message <code>grpc.core.Metric</code>
 */
class Metric extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    protected $value;

    public function __construct() {
        \GPBMetadata\Src\Proto\Grpc\Core\Stats::initOnce();
        parent::__construct();
    }

    /**
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint64 count = 10;</code>
     * @return int|string
     */
    public function getCount()
    {
        return $this->readOneof(10);
    }

    /**
     * Generated from protobuf field <code>uint64 count = 10;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCount($var)
    {
        GPBUtil::checkUint64($var);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.core.Histogram histogram = 11;</code>
     * @return \Grpc\Core\Histogram
     */
    public function getHistogram()
    {
        return $this->readOneof(11);
    }

    /**
     * Generated from protobuf field <code>.grpc.core.Histogram histogram = 11;</code>
     * @param \Grpc\Core\Histogram $var
     * @return $this
     */
    public function setHistogram($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Core\Histogram::class);
        $this->writeOneof(11, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getValue()
    {
        return $this->whichOneof("value");
    }

}

