<?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.Token</code>
 */
class Token extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.rv.data.UUID uuid = 1;</code>
     */
    protected $uuid = null;
    protected $TokenType;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Rv\Data\UUID $uuid
     *     @type \Rv\Data\Message\Token\TokenTypeText $text
     *     @type \Rv\Data\Message\Token\TokenTypeTimer $timer
     *     @type \Rv\Data\Message\Token\TokenTypeClock $clock
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Messages::initOnce();
        parent::__construct($data);
    }

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

    public function hasUuid()
    {
        return isset($this->uuid);
    }

    public function clearUuid()
    {
        unset($this->uuid);
    }

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

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

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

        return $this;
    }

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

}

