final public function asJson(
        $options = 0,
        $depth = 512)
    {
        if (!is_int($options) || !is_int($depth)) {
            throw new LazyJsonMapperException('Invalid non-integer function argument.');
        }

        // Create a fully-validated, fully-converted final object-tree.
        // NOTE: See `jsonSerialize()` for details about why we MUST do this.
        $objectData = $this->exportObjectDataCopy('stdClass'); // Throws.

        // Gracefully handle JSON encoding and validation.
        $jsonString = @json_encode($objectData, $options, $depth);
        if ($jsonString === false) {
            throw new LazyJsonMapperException(sprintf(
                'Failed to encode JSON string (error %d: "%s").',
                json_last_error(), json_last_error_msg()
            ));
        }

        return $jsonString;
    }