<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/v2/types.proto

namespace Google\Cloud\Bigtable\V2\Type\Struct;

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

/**
 * A struct field and its type.
 *
 * Generated from protobuf message <code>google.bigtable.v2.Type.Struct.Field</code>
 */
class Field extends \Google\Protobuf\Internal\Message
{
    /**
     * The field name (optional). Fields without a `field_name` are considered
     * anonymous and cannot be referenced by name.
     *
     * Generated from protobuf field <code>string field_name = 1;</code>
     */
    protected $field_name = '';
    /**
     * The type of values in this field.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type type = 2;</code>
     */
    protected $type = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $field_name
     *           The field name (optional). Fields without a `field_name` are considered
     *           anonymous and cannot be referenced by name.
     *     @type \Google\Cloud\Bigtable\V2\Type $type
     *           The type of values in this field.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Types::initOnce();
        parent::__construct($data);
    }

    /**
     * The field name (optional). Fields without a `field_name` are considered
     * anonymous and cannot be referenced by name.
     *
     * Generated from protobuf field <code>string field_name = 1;</code>
     * @return string
     */
    public function getFieldName()
    {
        return $this->field_name;
    }

    /**
     * The field name (optional). Fields without a `field_name` are considered
     * anonymous and cannot be referenced by name.
     *
     * Generated from protobuf field <code>string field_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setFieldName($var)
    {
        GPBUtil::checkString($var, True);
        $this->field_name = $var;

        return $this;
    }

    /**
     * The type of values in this field.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type type = 2;</code>
     * @return \Google\Cloud\Bigtable\V2\Type|null
     */
    public function getType()
    {
        return $this->type;
    }

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

    /**
     * The type of values in this field.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Type type = 2;</code>
     * @param \Google\Cloud\Bigtable\V2\Type $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Type::class);
        $this->type = $var;

        return $this;
    }

}

