public function setRequired(bool $required) : self
    {
        $required = (bool)$required;
        $this->required = $required;
        return $this;
    }
public function setRequired(bool $required) : self
    {
        $required = (bool)$required;
        $this->required = $required;
        return $this;
    }
public function setRequired ( bool $ required ) : self { $ required = ( bool ) $ required ; $ this -> required = $ required ; return $ this ; }
Set if the field is required.

@param bool $required True if this field is required.

@return self
Set if the field is required .