<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: qa.proto

namespace App\Grpc\Qa;

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

/**
 * 答案实体
 *
 * Generated from protobuf message <code>qa.AnswerEntity</code>
 */
class AnswerEntity extends \Google\Protobuf\Internal\Message
{
    /**
     * 回答id
     *
     * Generated from protobuf field <code>uint64 id = 1;</code>
     */
    protected $id = 0;
    /**
     * 问题id
     *
     * Generated from protobuf field <code>uint64 question_id = 2;</code>
     */
    protected $question_id = 0;
    /**
     * 回答内容
     *
     * Generated from protobuf field <code>string content = 3;</code>
     */
    protected $content = '';
    /**
     * 回答者
     *
     * Generated from protobuf field <code>string created_by = 4;</code>
     */
    protected $created_by = '';
    /**
     * 点赞数，添加时默认为0
     *
     * Generated from protobuf field <code>uint64 agree_count = 5;</code>
     */
    protected $agree_count = 0;
    /**
     * 当前用户是否点赞
     *
     * Generated from protobuf field <code>bool has_agreed = 6;</code>
     */
    protected $has_agreed = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $id
     *           回答id
     *     @type int|string $question_id
     *           问题id
     *     @type string $content
     *           回答内容
     *     @type string $created_by
     *           回答者
     *     @type int|string $agree_count
     *           点赞数，添加时默认为0
     *     @type bool $has_agreed
     *           当前用户是否点赞
     * }
     */
    public function __construct($data = NULL) {
        \App\Grpc\GPBMetadata\Qa::initOnce();
        parent::__construct($data);
    }

    /**
     * 回答id
     *
     * Generated from protobuf field <code>uint64 id = 1;</code>
     * @return int|string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * 回答id
     *
     * Generated from protobuf field <code>uint64 id = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkUint64($var);
        $this->id = $var;

        return $this;
    }

    /**
     * 问题id
     *
     * Generated from protobuf field <code>uint64 question_id = 2;</code>
     * @return int|string
     */
    public function getQuestionId()
    {
        return $this->question_id;
    }

    /**
     * 问题id
     *
     * Generated from protobuf field <code>uint64 question_id = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setQuestionId($var)
    {
        GPBUtil::checkUint64($var);
        $this->question_id = $var;

        return $this;
    }

    /**
     * 回答内容
     *
     * Generated from protobuf field <code>string content = 3;</code>
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * 回答内容
     *
     * Generated from protobuf field <code>string content = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, True);
        $this->content = $var;

        return $this;
    }

    /**
     * 回答者
     *
     * Generated from protobuf field <code>string created_by = 4;</code>
     * @return string
     */
    public function getCreatedBy()
    {
        return $this->created_by;
    }

    /**
     * 回答者
     *
     * Generated from protobuf field <code>string created_by = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setCreatedBy($var)
    {
        GPBUtil::checkString($var, True);
        $this->created_by = $var;

        return $this;
    }

    /**
     * 点赞数，添加时默认为0
     *
     * Generated from protobuf field <code>uint64 agree_count = 5;</code>
     * @return int|string
     */
    public function getAgreeCount()
    {
        return $this->agree_count;
    }

    /**
     * 点赞数，添加时默认为0
     *
     * Generated from protobuf field <code>uint64 agree_count = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAgreeCount($var)
    {
        GPBUtil::checkUint64($var);
        $this->agree_count = $var;

        return $this;
    }

    /**
     * 当前用户是否点赞
     *
     * Generated from protobuf field <code>bool has_agreed = 6;</code>
     * @return bool
     */
    public function getHasAgreed()
    {
        return $this->has_agreed;
    }

    /**
     * 当前用户是否点赞
     *
     * Generated from protobuf field <code>bool has_agreed = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setHasAgreed($var)
    {
        GPBUtil::checkBool($var);
        $this->has_agreed = $var;

        return $this;
    }

}

