testbox.system.modules.cbstreams.models

Class Builder

lucee.Component
    extended by testbox.system.modules.cbstreams.models.Builder

A mutable builder for a Stream. This allows the creation of a Stream by generating elements individually and adding them to the Builder (without the copying overhead that comes from using an ArrayList as a temporary buffer.) A stream builder has a lifecycle, which starts in a building phase, during which elements can be added, and then transitions to a built phase, after which elements may not be added. The built phase begins when the build() method is called, which creates an ordered Stream whose elements are the elements that were added to the stream builder, in the order they were added. See https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.Builder.html

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any jBuilder
          The Java Builder we represent.

    • access = public
    • returntype = any
    true false
    Constructor Summary
    init(any builder)
          Construct a CFML builder out of the Java Builder.
    Method Summary
    Builder add(any element)
         Adds an element to the stream being built.
    Stream build()
         Builds the stream, transitioning this builder to the built state.
    string getJBuilder()
    any setJBuilder(any jBuilder)
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init(any builder)

    Construct a CFML builder out of the Java Builder

    Parameters:
    builder

    Property Detail

    jBuilder

    property any jBuilder

    The Java Builder we represent

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    add

    public Builder add(any element)

    Adds an element to the stream being built.

    Parameters:
    element - The element to add to the builder

    build

    public Stream build()

    Builds the stream, transitioning this builder to the built state. An IllegalStateException is thrown if there are further attempts to operate on the builder after it has entered the built state.


    getJBuilder

    public string getJBuilder()


    setJBuilder

    public any setJBuilder(any jBuilder)

    Parameters:
    jBuilder