<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: apache/rocketmq/v2/definition.proto

namespace Apache\Rocketmq\V2;

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

/**
 * https://en.wikipedia.org/wiki/Exponential_backoff
 *
 * Generated from protobuf message <code>apache.rocketmq.v2.ExponentialBackoff</code>
 */
class ExponentialBackoff extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.google.protobuf.Duration initial = 1;</code>
     */
    protected $initial = null;
    /**
     * Generated from protobuf field <code>.google.protobuf.Duration max = 2;</code>
     */
    protected $max = null;
    /**
     * Generated from protobuf field <code>float multiplier = 3;</code>
     */
    protected $multiplier = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Duration $initial
     *     @type \Google\Protobuf\Duration $max
     *     @type float $multiplier
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Apache\Rocketmq\V2\Definition::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Duration initial = 1;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getInitial()
    {
        return $this->initial;
    }

    public function hasInitial()
    {
        return isset($this->initial);
    }

    public function clearInitial()
    {
        unset($this->initial);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Duration initial = 1;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setInitial($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->initial = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Duration max = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getMax()
    {
        return $this->max;
    }

    public function hasMax()
    {
        return isset($this->max);
    }

    public function clearMax()
    {
        unset($this->max);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Duration max = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setMax($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->max = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>float multiplier = 3;</code>
     * @return float
     */
    public function getMultiplier()
    {
        return $this->multiplier;
    }

    /**
     * Generated from protobuf field <code>float multiplier = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setMultiplier($var)
    {
        GPBUtil::checkFloat($var);
        $this->multiplier = $var;

        return $this;
    }

}

