<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_LabelType StructType
 * @subpackage Structs
 */
class JP_LabelType extends AbstractStructBase
{
    /**
     * The Code
     * Meta information extracted from the WSDL
     * - use: required
     * @var int
     */
    public $Code;
    /**
     * The Name
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Name;
    /**
     * The Description
     * Meta information extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $Description;
    /**
     * The SortPriority
     * @var int
     */
    public $SortPriority;
    /**
     * Constructor method for JP_LabelType
     * @uses JP_LabelType::setCode()
     * @uses JP_LabelType::setName()
     * @uses JP_LabelType::setDescription()
     * @uses JP_LabelType::setSortPriority()
     * @param int $code
     * @param string $name
     * @param string $description
     * @param int $sortPriority
     */
    public function __construct($code = null, $name = null, $description = null, $sortPriority = null)
    {
        $this
            ->setCode($code)
            ->setName($name)
            ->setDescription($description)
            ->setSortPriority($sortPriority);
    }
    /**
     * Get Code value
     * @return int
     */
    public function getCode()
    {
        return $this->Code;
    }
    /**
     * Set Code value
     * @param int $code
     * @return \StructType\JP_LabelType
     */
    public function setCode($code = null)
    {
        // validation for constraint: int
        if (!is_null($code) && !(is_int($code) || ctype_digit($code))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($code, true), gettype($code)), __LINE__);
        }
        $this->Code = $code;
        return $this;
    }
    /**
     * Get Name value
     * @return string|null
     */
    public function getName()
    {
        return $this->Name;
    }
    /**
     * Set Name value
     * @param string $name
     * @return \StructType\JP_LabelType
     */
    public function setName($name = null)
    {
        // validation for constraint: string
        if (!is_null($name) && !is_string($name)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__);
        }
        $this->Name = $name;
        return $this;
    }
    /**
     * Get Description value
     * @return string|null
     */
    public function getDescription()
    {
        return $this->Description;
    }
    /**
     * Set Description value
     * @param string $description
     * @return \StructType\JP_LabelType
     */
    public function setDescription($description = null)
    {
        // validation for constraint: string
        if (!is_null($description) && !is_string($description)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($description, true), gettype($description)), __LINE__);
        }
        $this->Description = $description;
        return $this;
    }
    /**
     * Get SortPriority value
     * @return int|null
     */
    public function getSortPriority()
    {
        return $this->SortPriority;
    }
    /**
     * Set SortPriority value
     * @param int $sortPriority
     * @return \StructType\JP_LabelType
     */
    public function setSortPriority($sortPriority = null)
    {
        // validation for constraint: int
        if (!is_null($sortPriority) && !(is_int($sortPriority) || ctype_digit($sortPriority))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($sortPriority, true), gettype($sortPriority)), __LINE__);
        }
        $this->SortPriority = $sortPriority;
        return $this;
    }
}
