An object which takes a series of key-value pairs and combines them into an object using a series of fold-left style method calls.
An object which takes a series of key-value pairs and combines them into an object using a series of fold-left style method calls.
the type of keys used by the Parser that this Builder will be used by
the type of primitive value types used by the Parser that this Builder will be used by
the type of object built by this Builder
3.0
A builder whose output is a cbor-formatted byte string.
A builder whose output is a cbor-formatted byte string.
3.0
A builder that creates maps.
A builder that creates maps.
3.0
A Builder which can be built piecewise.
A Builder which can be built piecewise.
the key types
the primitive value types
the type of object to build
case class Foo(a:String, b:Seq[JsonValue], c:String) val fooBuilder = (new PiecewiseBuilder[StringOrInt, JsonValue, Foo](new Foo("", Seq.empty, "")) .addDef(StringOrInt("a"), partitionedPrimitiveKeyDef({case JsonValueString(x) => Right(x)}, {(f:Foo, x:String) => f.copy(a = x)})) .addDef(StringOrInt("c"), partitionedPrimitiveKeyDef({case JsonValueString(x) => Right(x)}, {(f:Foo, x:String) => f.copy(c = x)})) .addDef(StringOrInt("b"), partitionedComplexKeyDef(new PrimitiveSeqBuilder[JsonValue], {(f:Foo, x:Seq[JsonValue]) => Right(f.copy(b = x))})) ) val jsonParser = new JsonParser jsonParser.parse(fooBuilder, """{"a":"","b":[]}""") // results in `Foo("", Seq.empty, "")` jsonParser.parse(fooBuilder, """{"a":"qwer","b":["z","x","c"],"c":"asdf"}""") // results in `Foo("qwer", Seq(JsonValueString("z"), JsonValueString("x"),JsonValueString("c")), "asdf")`
3.0
Inspired by https://github.com/scopt/scopt/
A builder whose output is a json-formatted string.
A builder whose output is a json-formatted string.
3.0
A Builder that will build a Vector of values, where each inner value is a primitive value.
A Builder that will build a Vector of values, where each inner value is a primitive value.
This builder ignores keys completely, and adds elements to the sequence in encounter order.
#apply will return a left if the value is a complex value.
the type of primitive values encountered
3.0
A Builder that will build a Vector of values, where each inner value is produced by the parameter builder.
A Builder that will build a Vector of values, where each inner value is produced by the parameter builder.
This builder ignores keys completely, and adds elements to the sequence in encounter order.
#apply will return a left if the value is a primitive value.
the type of keys encountered
the type of primitive values encountered
the type of complex values produced by the childBuilder
3.0
Holds MapChildBuilder and several MapBuilder factory methods
Holds MapChildBuilder and several MapBuilder factory methods
3.0
KeyDef and several implementations
KeyDef and several implementations
3.0
PrettyParams and two implementations of it.
PrettyParams and two implementations of it.
3.0
Contains the various built-in builders.
Most built-in builders either build a serialized form (json, cbor), build a generic collection class (seq, map) or build a class that conforms to a stereotype (java bean, case class)