public function finish(\Caridea\Validate\Registry $registry): \Caridea\Validate\Rule
    {
        if ($this->validator instanceof \Caridea\Validate\Validator) {
            return $this;
        } else {
            $rule = clone $this;
            $builder = $registry->builder();
            switch ($this->operator) {
                case "nested_object":
                case "list_objects":
                    $rule->validator = $builder->build($this->validator);
                    return $rule;
                case "list":
                    $rule->validator = $builder->build((object)['entry' => $this->validator]);
                    return $rule;
                case "list_different_objects":
                case "variable_object":
                    $validators = [];
                    foreach ($this->validator as $value => $ruleset) {
                        $validators[$value] = $builder->build($ruleset);
                    }
                    $rule->validator = new \Caridea\Validate\SwitchValidator($this->field, $validators);
                    return $rule;
            }
        }
    }