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

namespace Rv\Data\Message;

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

/**
 * Generated from protobuf message <code>rv.data.Message.TokenValue</code>
 */
class TokenValue extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.rv.data.UUID token_id = 1;</code>
     */
    protected $token_id = null;
    /**
     * Generated from protobuf field <code>string token_name = 5;</code>
     */
    protected $token_name = '';
    protected $TokenValueType;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Rv\Data\UUID $token_id
     *     @type string $token_name
     *     @type \Rv\Data\Message\TokenValue\TokenValueText $text
     *     @type \Rv\Data\Message\TokenValue\TokenValueTimer $timer
     *     @type \Rv\Data\Message\TokenValue\TokenValueClock $clock
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Messages::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.rv.data.UUID token_id = 1;</code>
     * @return \Rv\Data\UUID|null
     */
    public function getTokenId()
    {
        return $this->token_id;
    }

    public function hasTokenId()
    {
        return isset($this->token_id);
    }

    public function clearTokenId()
    {
        unset($this->token_id);
    }

    /**
     * Generated from protobuf field <code>.rv.data.UUID token_id = 1;</code>
     * @param \Rv\Data\UUID $var
     * @return $this
     */
    public function setTokenId($var)
    {
        GPBUtil::checkMessage($var, \Rv\Data\UUID::class);
        $this->token_id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string token_name = 5;</code>
     * @return string
     */
    public function getTokenName()
    {
        return $this->token_name;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.rv.data.Message.TokenValue.TokenValueText text = 2;</code>
     * @return \Rv\Data\Message\TokenValue\TokenValueText|null
     */
    public function getText()
    {
        return $this->readOneof(2);
    }

    public function hasText()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.rv.data.Message.TokenValue.TokenValueText text = 2;</code>
     * @param \Rv\Data\Message\TokenValue\TokenValueText $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkMessage($var, \Rv\Data\Message\TokenValue\TokenValueText::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.rv.data.Message.TokenValue.TokenValueTimer timer = 3;</code>
     * @return \Rv\Data\Message\TokenValue\TokenValueTimer|null
     */
    public function getTimer()
    {
        return $this->readOneof(3);
    }

    public function hasTimer()
    {
        return $this->hasOneof(3);
    }

    /**
     * Generated from protobuf field <code>.rv.data.Message.TokenValue.TokenValueTimer timer = 3;</code>
     * @param \Rv\Data\Message\TokenValue\TokenValueTimer $var
     * @return $this
     */
    public function setTimer($var)
    {
        GPBUtil::checkMessage($var, \Rv\Data\Message\TokenValue\TokenValueTimer::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.rv.data.Message.TokenValue.TokenValueClock clock = 4;</code>
     * @return \Rv\Data\Message\TokenValue\TokenValueClock|null
     */
    public function getClock()
    {
        return $this->readOneof(4);
    }

    public function hasClock()
    {
        return $this->hasOneof(4);
    }

    /**
     * Generated from protobuf field <code>.rv.data.Message.TokenValue.TokenValueClock clock = 4;</code>
     * @param \Rv\Data\Message\TokenValue\TokenValueClock $var
     * @return $this
     */
    public function setClock($var)
    {
        GPBUtil::checkMessage($var, \Rv\Data\Message\TokenValue\TokenValueClock::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

