public function setResultDataType($resultDataType)
    {
        if (is_string($resultDataType) && class_exists($resultDataType)) {
            $resultDataType = new $resultDataType();
        }

        if ($resultDataType instanceof DataInterface) {
            $this->resultDataType = $resultDataType;
        }

        $objectType = is_object($resultDataType) ? get_class($resultDataType) : gettype($resultDataType);

        if (is_array($this->resultDataType)) {
            throw new \Exception(sprintf('Result data type must be instanceof %s, %s given.',
                DataInterface::class,
                $objectType
            ));
        }
    }