PKI-Lite - v1.0.5
    Preparing search index...

    Interface for synchronous builder pattern implementations.

    Builders provide a fluent API for constructing complex objects step by step. This interface defines the contract for builders that can complete their construction synchronously.

    class SimpleDataBuilder implements Builder<SimpleData> {
    private data: string = ''

    setData(data: string): this {
    this.data = data
    return this
    }

    build(): SimpleData {
    return new SimpleData(this.data)
    }
    }

    const result = new SimpleDataBuilder()
    .setData('Hello')
    .build()
    interface Builder<T> {
        build(): T;
    }

    Type Parameters

    • T

      The type of object being built

    Index

    Methods

    Methods