public class BuildSpec extends heretical.pointer.operation.BuildSpec<BuildSpec>
To map child elements from one nested object to another, see CopySpec
and related operations.
When using a BuildSpec, you are declaring that a field value is put into a specific location in a nested object type.
When a BuildSpec is created, the target root location of all the values must be declared, or all values will be placed immediately below the root object.
For example, you want to put a field named firstName
it into a JSON tree at /person/firstName
there are two ways to use a BuildSpec.
Either
new BuildSpec().putInto( "firstName", "/person/firstName" );
Or
new BuildSpec( "/person" ).putInto( "firstName", "/firstName" );
Note that a field being copied or put into the new object can also be a nested object. In the case of JSON if the object to be copied is a JSON String, the value can be converted to a JSON object on the copy.
new BuildSpec().putInto( "person", JSONCoercibleType.TYPE, "/person" );
This example assumes the person
field is a valid JSON String or already a JSON JsonNode
instance.
CopySpec
,
Serialized FormConstructor and Description |
---|
BuildSpec() |
BuildSpec(java.lang.String intoPointer) |
BuildSpec(java.lang.String intoPointer,
java.lang.reflect.Type defaultType) |
BuildSpec(java.lang.reflect.Type defaultType) |
Copyright © 2007-2017 Cascading Maintainers. All Rights Reserved.