Package zeroecho.sdk.builders.core


package zeroecho.sdk.builders.core
Core builders for composing streaming DataContent pipelines and plain sources.

This package provides a small set of generic builder interfaces plus plain-content builders for bytes, strings, and files. Builders create DataContent stages that can be chained so that each stage reads from the previous one while applying transformation or sourcing bytes.

What is here

Chaining model

A chain builder holds the current tail stage. Each add(...) call builds the next stage (in a consistent encrypt/decrypt mode) and links the previous tail as its input. The final build() returns the tail, which internally references the rest of the chain via setInput(...).

Typical usage

// Encrypt: plain text -> (for example) AES-GCM stage defined elsewhere.
zeroecho.sdk.content.api.DataContent chain =
    zeroecho.sdk.builders.core.DataContentChainBuilder.encrypt()
        .add(zeroecho.sdk.builders.core.PlainStringBuilder.builder().value("hello"))
        // .add(zeroecho.sdk.builders.alg.AesDataContentBuilder.builder().modeGcm(128).generateKey(256))
        .build();

// Decrypt: build the inverse chain with the decrypt() factory.
zeroecho.sdk.content.api.DataContent decChain =
    zeroecho.sdk.builders.core.DataContentChainBuilder.decrypt()
        // .add(zeroecho.sdk.builders.alg.AesDataContentBuilder.builder().modeGcm(128).withHeader())
        .build();

Notes

  • Plain-content builders ignore the encrypt/decrypt flag; they simply provide bytes.
  • Builders and produced stages are not thread-safe; configure and use per pipeline.
Since:
1.0