<?php

namespace App\Entities\PagSeguro\Share;

use App\Utils\Builder;

class PagSeguroAddressBuilder implements Builder {
	protected $street;
	protected $number;
	protected $complement;
	protected $locality;
	protected $city;
	protected $region;
	protected $region_code;
	protected $country;
	protected $postal_code;

	public function build(): PagSeguroAddress {

		$obj = new PagSeguroAddress();
		$obj->setStreet( $this->street );
		$obj->setRegionCode( $this->region_code );
		if (isset( $this->region )) {
			$obj->setRegion( $this->region );
		}
		$obj->setPostalCode( $this->postal_code );
		$obj->setNumber( $this->number );
		$obj->setLocality( $this->locality );
		$obj->setCountry( $this->country );
		$obj->setComplement( $this->complement );
		$obj->setCity( $this->city );

		return $obj;

	}

	/**
	 *
	 * @param mixed $street
	 */
	public function setStreet($street): PagSeguroAddressBuilder {

		$this->street = $street;
		return $this;

	}

	/**
	 *
	 * @param mixed $number
	 */
	public function setNumber($number): PagSeguroAddressBuilder {

		$this->number = $number;
		return $this;

	}

	/**
	 *
	 * @param mixed $complement
	 */
	public function setComplement($complement): PagSeguroAddressBuilder {

		$this->complement = $complement;
		return $this;

	}

	/**
	 *
	 * @param mixed $locality
	 */
	public function setLocality($locality): PagSeguroAddressBuilder {

		$this->locality = $locality;
		return $this;

	}

	/**
	 *
	 * @param mixed $city
	 */
	public function setCity($city): PagSeguroAddressBuilder {

		$this->city = $city;
		return $this;

	}

	/**
	 *
	 * @param mixed $region
	 */
	public function setRegion($region): PagSeguroAddressBuilder {

		$this->region = $region;
		return $this;

	}

	/**
	 *
	 * @param mixed $region_code
	 */
	public function setRegion_code($region_code): PagSeguroAddressBuilder {

		$this->region_code = $region_code;
		return $this;

	}

	/**
	 *
	 * @param mixed $country
	 */
	public function setCountry($country): PagSeguroAddressBuilder {

		$this->country = $country;
		return $this;

	}

	/**
	 *
	 * @param mixed $postal_code
	 */
	public function setPostal_code($postal_code): PagSeguroAddressBuilder {

		$this->postal_code = $postal_code;
		return $this;

	}

}

