A builder that will create cbor object format byte strings
A builder that will create cbor object format byte strings
true if the builder should create an object even if it is possible to create an array from the inputs
The type of object while folding.
The type of object while folding.
If Builder
weren't so whitebox, this would be a hidden implementation detail.
4.0
Add a key-value pair to folding
Add a key-value pair to folding
The key is key
, and the value is the result of com.rayrobdod.json.parser.Parser.parse on the provided input
.
the object to be added to. Must be either the return value of init or the return value of apply
the key of a key-value pair
the input to a parser
a parser for turning input into a value
either a built value or an error value
A function to be called after the folding to produce a result
A function to be called after the folding to produce a result
Taking advantage of this method might be useful if either Middle
is
mutable for performance reasons and Result
should be immutable or
if the builder needs to use multiple key-value pairs fromt the source
to produce some value in the domain object.
If there is no need to take advantage of this, the implementation of this method can be
override def finish[BFE](bfe:BFE)(x:Middle) = ParserRetVal.Complex(x)
the object to be converted. Must be either the return value of init or the return value of apply
either a built value or an error value
4.0
Change the type of key that this builder requires, with the option of indicating an error condition
Change the type of key that this builder requires, with the option of indicating an error condition
a conversion function from the new key to this's key
3.1
Change the type of result produced by this builder, with the option of indicating an error condition
Change the type of result produced by this builder, with the option of indicating an error condition
4.0
Change the type of value that this builder requires, with the option of indicating an error condition
Change the type of value that this builder requires, with the option of indicating an error condition
3.0
An 'empty' object.
An 'empty' object. Can be thought of as either the value used at the start of a fold-left operation, or as an object filled with default values.
Change the type of failure produced by this builder
Change the type of failure produced by this builder
4.0
Change the type of key that this builder requires
Change the type of key that this builder requires
a conversion function from the new key to this's key
3.0
Change the type of result produced by this builder
Change the type of result produced by this builder
4.0
Change the type of value that this builder requires
Change the type of value that this builder requires
a conversion function from the new value to this's value
3.0
Create a Builder which builds two items from the same input.
Create a Builder which builds two items from the same input. The first
item built being the one that this
would build, and the second item
built being the one that that
would build.
Most useful if the Parser input is neither stable nor resendable - say a network stream.
the other builder
3.1
A builder whose output is a cbor-formatted byte string.
Regarding numbers
I imagine giving this thing enough key-value pairs will result in an OutOfMemoryError when it tries to create the byte array, but I have yet to go about trying to detect and fast-fail in that situation, or creating a structure that is indistinguishable from a really long byte array
And beyond that, Cbor maps and arrays have a hard size limit of
2 ** 64 - 1
entries, even if the byte array size issue is overcome. Well, assuming they're fixed arrays and not indefinite arrays, but so far this only writes definite-length arrays.4.0
3.0
http://tools.ietf.org/html/rfc7049