src/builder/fieldset-builder.ts
Methods |
|
constructor(code: string, description: string)
|
Defined in src/builder/fieldset-builder.ts:6
|
Public addQuestion | ||||||||
addQuestion(question: Question
|
||||||||
Defined in src/builder/fieldset-builder.ts:16
|
||||||||
Parameters :
Returns :
void
|
Public build |
build()
|
Defined in src/builder/fieldset-builder.ts:20
|
Returns :
Fieldset
|
import { GroupBuilder } from '.';
import { Fieldset } from '../group';
import { Question } from '../question';
import { Validation } from '../validation';
export class FieldsetBuilder extends GroupBuilder<Question<any>> {
public constructor(
code: string,
description: string
) {
super(code, description);
this.questions = [];
}
public addQuestion(question: Question<any>): void {
this.questions.push(question);
}
public build(): Fieldset {
return new Fieldset(
this.code,
this.description,
this.questions
);
}
}