<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/products/v1/products_common.proto

namespace Google\Shopping\Merchant\Products\V1\ProductAttributes;

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

/**
 * The unit area of the property.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductAttributes.UnitArea</code>
 */
class UnitArea extends \Google\Protobuf\Internal\Message
{
    /**
     * The area value.
     *
     * Generated from protobuf field <code>optional double value = 1;</code>
     */
    protected $value = null;
    /**
     * The unit of area.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.UnitArea.Unit unit = 2;</code>
     */
    protected $unit = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $value
     *           The area value.
     *     @type int $unit
     *           The unit of area.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The area value.
     *
     * Generated from protobuf field <code>optional double value = 1;</code>
     * @return float
     */
    public function getValue()
    {
        return isset($this->value) ? $this->value : 0.0;
    }

    public function hasValue()
    {
        return isset($this->value);
    }

    public function clearValue()
    {
        unset($this->value);
    }

    /**
     * The area value.
     *
     * Generated from protobuf field <code>optional double value = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkDouble($var);
        $this->value = $var;

        return $this;
    }

    /**
     * The unit of area.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.UnitArea.Unit unit = 2;</code>
     * @return int
     */
    public function getUnit()
    {
        return $this->unit;
    }

    /**
     * The unit of area.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.UnitArea.Unit unit = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setUnit($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\ProductAttributes\UnitArea\Unit::class);
        $this->unit = $var;

        return $this;
    }

}

