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

namespace Protocol\NodeInfo;

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

/**
 * Generated from protobuf message <code>protocol.NodeInfo.PeerInfo</code>
 */
class PeerInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string lastSyncBlock = 1;</code>
     */
    protected $lastSyncBlock = '';
    /**
     * Generated from protobuf field <code>int64 remainNum = 2;</code>
     */
    protected $remainNum = 0;
    /**
     * Generated from protobuf field <code>int64 lastBlockUpdateTime = 3;</code>
     */
    protected $lastBlockUpdateTime = 0;
    /**
     * Generated from protobuf field <code>bool syncFlag = 4;</code>
     */
    protected $syncFlag = false;
    /**
     * Generated from protobuf field <code>int64 headBlockTimeWeBothHave = 5;</code>
     */
    protected $headBlockTimeWeBothHave = 0;
    /**
     * Generated from protobuf field <code>bool needSyncFromPeer = 6;</code>
     */
    protected $needSyncFromPeer = false;
    /**
     * Generated from protobuf field <code>bool needSyncFromUs = 7;</code>
     */
    protected $needSyncFromUs = false;
    /**
     * Generated from protobuf field <code>string host = 8;</code>
     */
    protected $host = '';
    /**
     * Generated from protobuf field <code>int32 port = 9;</code>
     */
    protected $port = 0;
    /**
     * Generated from protobuf field <code>string nodeId = 10;</code>
     */
    protected $nodeId = '';
    /**
     * Generated from protobuf field <code>int64 connectTime = 11;</code>
     */
    protected $connectTime = 0;
    /**
     * Generated from protobuf field <code>double avgLatency = 12;</code>
     */
    protected $avgLatency = 0.0;
    /**
     * Generated from protobuf field <code>int32 syncToFetchSize = 13;</code>
     */
    protected $syncToFetchSize = 0;
    /**
     * Generated from protobuf field <code>int64 syncToFetchSizePeekNum = 14;</code>
     */
    protected $syncToFetchSizePeekNum = 0;
    /**
     * Generated from protobuf field <code>int32 syncBlockRequestedSize = 15;</code>
     */
    protected $syncBlockRequestedSize = 0;
    /**
     * Generated from protobuf field <code>int64 unFetchSynNum = 16;</code>
     */
    protected $unFetchSynNum = 0;
    /**
     * Generated from protobuf field <code>int32 blockInPorcSize = 17;</code>
     */
    protected $blockInPorcSize = 0;
    /**
     * Generated from protobuf field <code>string headBlockWeBothHave = 18;</code>
     */
    protected $headBlockWeBothHave = '';
    /**
     * Generated from protobuf field <code>bool isActive = 19;</code>
     */
    protected $isActive = false;
    /**
     * Generated from protobuf field <code>int32 score = 20;</code>
     */
    protected $score = 0;
    /**
     * Generated from protobuf field <code>int32 nodeCount = 21;</code>
     */
    protected $nodeCount = 0;
    /**
     * Generated from protobuf field <code>int64 inFlow = 22;</code>
     */
    protected $inFlow = 0;
    /**
     * Generated from protobuf field <code>int32 disconnectTimes = 23;</code>
     */
    protected $disconnectTimes = 0;
    /**
     * Generated from protobuf field <code>string localDisconnectReason = 24;</code>
     */
    protected $localDisconnectReason = '';
    /**
     * Generated from protobuf field <code>string remoteDisconnectReason = 25;</code>
     */
    protected $remoteDisconnectReason = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $lastSyncBlock
     *     @type int|string $remainNum
     *     @type int|string $lastBlockUpdateTime
     *     @type bool $syncFlag
     *     @type int|string $headBlockTimeWeBothHave
     *     @type bool $needSyncFromPeer
     *     @type bool $needSyncFromUs
     *     @type string $host
     *     @type int $port
     *     @type string $nodeId
     *     @type int|string $connectTime
     *     @type float $avgLatency
     *     @type int $syncToFetchSize
     *     @type int|string $syncToFetchSizePeekNum
     *     @type int $syncBlockRequestedSize
     *     @type int|string $unFetchSynNum
     *     @type int $blockInPorcSize
     *     @type string $headBlockWeBothHave
     *     @type bool $isActive
     *     @type int $score
     *     @type int $nodeCount
     *     @type int|string $inFlow
     *     @type int $disconnectTimes
     *     @type string $localDisconnectReason
     *     @type string $remoteDisconnectReason
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Core\Tron::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 remainNum = 2;</code>
     * @return int|string
     */
    public function getRemainNum()
    {
        return $this->remainNum;
    }

    /**
     * Generated from protobuf field <code>int64 remainNum = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setRemainNum($var)
    {
        GPBUtil::checkInt64($var);
        $this->remainNum = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 lastBlockUpdateTime = 3;</code>
     * @return int|string
     */
    public function getLastBlockUpdateTime()
    {
        return $this->lastBlockUpdateTime;
    }

    /**
     * Generated from protobuf field <code>int64 lastBlockUpdateTime = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setLastBlockUpdateTime($var)
    {
        GPBUtil::checkInt64($var);
        $this->lastBlockUpdateTime = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool syncFlag = 4;</code>
     * @return bool
     */
    public function getSyncFlag()
    {
        return $this->syncFlag;
    }

    /**
     * Generated from protobuf field <code>bool syncFlag = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setSyncFlag($var)
    {
        GPBUtil::checkBool($var);
        $this->syncFlag = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 headBlockTimeWeBothHave = 5;</code>
     * @return int|string
     */
    public function getHeadBlockTimeWeBothHave()
    {
        return $this->headBlockTimeWeBothHave;
    }

    /**
     * Generated from protobuf field <code>int64 headBlockTimeWeBothHave = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setHeadBlockTimeWeBothHave($var)
    {
        GPBUtil::checkInt64($var);
        $this->headBlockTimeWeBothHave = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool needSyncFromPeer = 6;</code>
     * @return bool
     */
    public function getNeedSyncFromPeer()
    {
        return $this->needSyncFromPeer;
    }

    /**
     * Generated from protobuf field <code>bool needSyncFromPeer = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setNeedSyncFromPeer($var)
    {
        GPBUtil::checkBool($var);
        $this->needSyncFromPeer = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool needSyncFromUs = 7;</code>
     * @return bool
     */
    public function getNeedSyncFromUs()
    {
        return $this->needSyncFromUs;
    }

    /**
     * Generated from protobuf field <code>bool needSyncFromUs = 7;</code>
     * @param bool $var
     * @return $this
     */
    public function setNeedSyncFromUs($var)
    {
        GPBUtil::checkBool($var);
        $this->needSyncFromUs = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string host = 8;</code>
     * @return string
     */
    public function getHost()
    {
        return $this->host;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 port = 9;</code>
     * @return int
     */
    public function getPort()
    {
        return $this->port;
    }

    /**
     * Generated from protobuf field <code>int32 port = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setPort($var)
    {
        GPBUtil::checkInt32($var);
        $this->port = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string nodeId = 10;</code>
     * @return string
     */
    public function getNodeId()
    {
        return $this->nodeId;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 connectTime = 11;</code>
     * @return int|string
     */
    public function getConnectTime()
    {
        return $this->connectTime;
    }

    /**
     * Generated from protobuf field <code>int64 connectTime = 11;</code>
     * @param int|string $var
     * @return $this
     */
    public function setConnectTime($var)
    {
        GPBUtil::checkInt64($var);
        $this->connectTime = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>double avgLatency = 12;</code>
     * @return float
     */
    public function getAvgLatency()
    {
        return $this->avgLatency;
    }

    /**
     * Generated from protobuf field <code>double avgLatency = 12;</code>
     * @param float $var
     * @return $this
     */
    public function setAvgLatency($var)
    {
        GPBUtil::checkDouble($var);
        $this->avgLatency = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 syncToFetchSize = 13;</code>
     * @return int
     */
    public function getSyncToFetchSize()
    {
        return $this->syncToFetchSize;
    }

    /**
     * Generated from protobuf field <code>int32 syncToFetchSize = 13;</code>
     * @param int $var
     * @return $this
     */
    public function setSyncToFetchSize($var)
    {
        GPBUtil::checkInt32($var);
        $this->syncToFetchSize = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 syncToFetchSizePeekNum = 14;</code>
     * @return int|string
     */
    public function getSyncToFetchSizePeekNum()
    {
        return $this->syncToFetchSizePeekNum;
    }

    /**
     * Generated from protobuf field <code>int64 syncToFetchSizePeekNum = 14;</code>
     * @param int|string $var
     * @return $this
     */
    public function setSyncToFetchSizePeekNum($var)
    {
        GPBUtil::checkInt64($var);
        $this->syncToFetchSizePeekNum = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 syncBlockRequestedSize = 15;</code>
     * @return int
     */
    public function getSyncBlockRequestedSize()
    {
        return $this->syncBlockRequestedSize;
    }

    /**
     * Generated from protobuf field <code>int32 syncBlockRequestedSize = 15;</code>
     * @param int $var
     * @return $this
     */
    public function setSyncBlockRequestedSize($var)
    {
        GPBUtil::checkInt32($var);
        $this->syncBlockRequestedSize = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 unFetchSynNum = 16;</code>
     * @return int|string
     */
    public function getUnFetchSynNum()
    {
        return $this->unFetchSynNum;
    }

    /**
     * Generated from protobuf field <code>int64 unFetchSynNum = 16;</code>
     * @param int|string $var
     * @return $this
     */
    public function setUnFetchSynNum($var)
    {
        GPBUtil::checkInt64($var);
        $this->unFetchSynNum = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 blockInPorcSize = 17;</code>
     * @return int
     */
    public function getBlockInPorcSize()
    {
        return $this->blockInPorcSize;
    }

    /**
     * Generated from protobuf field <code>int32 blockInPorcSize = 17;</code>
     * @param int $var
     * @return $this
     */
    public function setBlockInPorcSize($var)
    {
        GPBUtil::checkInt32($var);
        $this->blockInPorcSize = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string headBlockWeBothHave = 18;</code>
     * @return string
     */
    public function getHeadBlockWeBothHave()
    {
        return $this->headBlockWeBothHave;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool isActive = 19;</code>
     * @return bool
     */
    public function getIsActive()
    {
        return $this->isActive;
    }

    /**
     * Generated from protobuf field <code>bool isActive = 19;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsActive($var)
    {
        GPBUtil::checkBool($var);
        $this->isActive = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 score = 20;</code>
     * @return int
     */
    public function getScore()
    {
        return $this->score;
    }

    /**
     * Generated from protobuf field <code>int32 score = 20;</code>
     * @param int $var
     * @return $this
     */
    public function setScore($var)
    {
        GPBUtil::checkInt32($var);
        $this->score = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 nodeCount = 21;</code>
     * @return int
     */
    public function getNodeCount()
    {
        return $this->nodeCount;
    }

    /**
     * Generated from protobuf field <code>int32 nodeCount = 21;</code>
     * @param int $var
     * @return $this
     */
    public function setNodeCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->nodeCount = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 inFlow = 22;</code>
     * @return int|string
     */
    public function getInFlow()
    {
        return $this->inFlow;
    }

    /**
     * Generated from protobuf field <code>int64 inFlow = 22;</code>
     * @param int|string $var
     * @return $this
     */
    public function setInFlow($var)
    {
        GPBUtil::checkInt64($var);
        $this->inFlow = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 disconnectTimes = 23;</code>
     * @return int
     */
    public function getDisconnectTimes()
    {
        return $this->disconnectTimes;
    }

    /**
     * Generated from protobuf field <code>int32 disconnectTimes = 23;</code>
     * @param int $var
     * @return $this
     */
    public function setDisconnectTimes($var)
    {
        GPBUtil::checkInt32($var);
        $this->disconnectTimes = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string localDisconnectReason = 24;</code>
     * @return string
     */
    public function getLocalDisconnectReason()
    {
        return $this->localDisconnectReason;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string remoteDisconnectReason = 25;</code>
     * @return string
     */
    public function getRemoteDisconnectReason()
    {
        return $this->remoteDisconnectReason;
    }

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

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(PeerInfo::class, \Protocol\NodeInfo_PeerInfo::class);

