<?php

/**
 * This class has been generated by dagger-php-sdk. DO NOT EDIT.
 */

declare(strict_types=1);

namespace Dagger;

class SearchSubmatch extends Client\AbstractObject implements Client\IdAble
{
    /**
     * The match's end offset within the matched lines.
     */
    public function end(): int
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('end');
        return (int)$this->queryLeaf($leafQueryBuilder, 'end');
    }

    /**
     * A unique identifier for this SearchSubmatch.
     */
    public function id(): SearchSubmatchId
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('id');
        return new \Dagger\SearchSubmatchId((string)$this->queryLeaf($leafQueryBuilder, 'id'));
    }

    /**
     * The match's start offset within the matched lines.
     */
    public function start(): int
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('start');
        return (int)$this->queryLeaf($leafQueryBuilder, 'start');
    }

    /**
     * The matched text.
     */
    public function text(): string
    {
        $leafQueryBuilder = new \Dagger\Client\QueryBuilder('text');
        return (string)$this->queryLeaf($leafQueryBuilder, 'text');
    }
}
