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
DataContentBuilder- functional interface that builds aDataContentconfigured for encryption or decryption.DataContentChainBuilder- composes multipleDataContentBuilderinstances into one tail stage viasetInput(...)chaining.PlainBytesBuilder- wraps a caller-provided byte array as plain content.PlainStringBuilder- wraps aStringas plain content.PlainFileBuilder- wraps aURL-addressed file as plain content.
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
-
ClassDescriptionDataContentBuilder<T extends DataContent>A builder interface for constructing instances of
DataContent.A builder interface for constructing a chain ofDataContentcomponents, where each content unit passes its output as the input to the next one.Default implementation ofDataContentChainBuilder.Builder interface for constructingPlainBytesinstances that encapsulate unencrypted byte array content.Default implementation of thePlainBytesBuilderinterface.Builder interface for constructingPlainContentinstances that represent unencrypted file-based content sourced from aURL.Default implementation of thePlainFileBuilderinterface.Builder interface for constructingPlainStringinstances, which represent unencrypted textual content.Default implementation of thePlainStringBuilderinterface.