lucee.Component 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
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
any
|
jBuilder
The Java Builder we represent.
|
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 |
---|
Construct a CFML builder out of the Java Builder
builder
Property Detail |
---|
The Java Builder we represent
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Adds an element to the stream being built.
element
- The element to add to the builderBuilds 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.
jBuilder