@@ -24,15 +24,11 @@ public class MapperBuilderContext {
2424 * The root context, to be used when building a tree of mappers
2525 */
2626 public static MapperBuilderContext root (boolean isSourceSynthetic , boolean isDataStream ) {
27- return MapperBuilderContext . builder (). isSourceSynthetic ( isSourceSynthetic ). isDataStream ( isDataStream ). build ( );
27+ return root ( isSourceSynthetic , isDataStream , MergeReason . MAPPING_UPDATE );
2828 }
2929
3030 public static MapperBuilderContext root (boolean isSourceSynthetic , boolean isDataStream , MergeReason mergeReason ) {
31- return MapperBuilderContext .builder ()
32- .isSourceSynthetic (isSourceSynthetic )
33- .isDataStream (isDataStream )
34- .mergeReason (mergeReason )
35- .build ();
31+ return new MapperBuilderContext (null , isSourceSynthetic , isDataStream , false , ObjectMapper .Defaults .DYNAMIC , mergeReason , false );
3632 }
3733
3834 private final String path ;
@@ -150,66 +146,4 @@ public MergeReason getMergeReason() {
150146 public boolean isInNestedContext () {
151147 return inNestedContext ;
152148 }
153-
154- public static Builder builder () {
155- return new Builder ();
156- }
157-
158- public static final class Builder {
159-
160- private String path = null ;
161- private boolean isSourceSynthetic ;
162- private boolean isDataStream ;
163- private boolean parentObjectContainsDimensions = false ;
164- private ObjectMapper .Dynamic dynamic = ObjectMapper .Defaults .DYNAMIC ;
165- private MergeReason mergeReason = MergeReason .MAPPING_UPDATE ;
166- private boolean inNestedContext = false ;
167-
168- public Builder path (String path ) {
169- this .path = path ;
170- return this ;
171- }
172-
173- public Builder isSourceSynthetic (boolean isSourceSynthetic ) {
174- this .isSourceSynthetic = isSourceSynthetic ;
175- return this ;
176- }
177-
178- public Builder isDataStream (boolean isDataStream ) {
179- this .isDataStream = isDataStream ;
180- return this ;
181- }
182-
183- public Builder parentObjectContainsDimensions (boolean parentObjectContainsDimensions ) {
184- this .parentObjectContainsDimensions = parentObjectContainsDimensions ;
185- return this ;
186- }
187-
188- public Builder dynamic (ObjectMapper .Dynamic dynamic ) {
189- this .dynamic = dynamic ;
190- return this ;
191- }
192-
193- public Builder mergeReason (MergeReason mergeReason ) {
194- this .mergeReason = mergeReason ;
195- return this ;
196- }
197-
198- public Builder inNestedContext (boolean inNestedContext ) {
199- this .inNestedContext = inNestedContext ;
200- return this ;
201- }
202-
203- public MapperBuilderContext build () {
204- return new MapperBuilderContext (
205- path ,
206- isSourceSynthetic ,
207- isDataStream ,
208- parentObjectContainsDimensions ,
209- dynamic ,
210- mergeReason ,
211- inNestedContext
212- );
213- }
214- }
215149}
0 commit comments