Class PlainBytesBuilder.DefaultPlainBytesBuilder

java.lang.Object
zeroecho.sdk.builders.core.PlainBytesBuilder.DefaultPlainBytesBuilder
All Implemented Interfaces:
DataContentBuilder<PlainContent>, PlainBytesBuilder
Enclosing interface:
PlainBytesBuilder

public static final class PlainBytesBuilder.DefaultPlainBytesBuilder extends Object implements PlainBytesBuilder
Default implementation of the PlainBytesBuilder interface.

Builds a PlainBytes instance wrapping the specified byte array.

  • Method Details

    • bytes

      public PlainBytesBuilder bytes(byte[] bytes)
      Description copied from interface: PlainBytesBuilder
      Sets the byte array content to be wrapped by PlainBytes.
      Specified by:
      bytes in interface PlainBytesBuilder
      Parameters:
      bytes - the byte array; must not be null
      Returns:
      this builder instance for method chaining
    • build

      public PlainContent build(boolean encrypt)
      Description copied from interface: DataContentBuilder
      Constructs and returns a new DataContent instance based on the builder's current configuration.
      Specified by:
      build in interface DataContentBuilder<PlainContent>
      Parameters:
      encrypt - whether the resulting DataContent should be configured for encryption (true) or decryption (false). In encryption mode, additional headers or metadata may be inserted into the stream which must be retained for successful decryption.
      Returns:
      the constructed DataContent instance