4141import com .arangodb .internal .CollectionCache .DBAccess ;
4242import com .arangodb .internal .DocumentCache ;
4343import com .arangodb .internal .InternalArangoDB ;
44- import com .arangodb .internal .velocypack .VPackConfigure ;
45- import com .arangodb .internal .velocypack .VPackConfigureAsync ;
44+ import com .arangodb .internal .velocypack .VPackDriverModule ;
4645import com .arangodb .internal .velocystream .Communication ;
4746import com .arangodb .internal .velocystream .CommunicationAsync ;
4847import com .arangodb .internal .velocystream .CommunicationSync ;
6160import com .arangodb .velocypack .VPackInstanceCreator ;
6261import com .arangodb .velocypack .VPackJsonDeserializer ;
6362import com .arangodb .velocypack .VPackJsonSerializer ;
63+ import com .arangodb .velocypack .VPackModule ;
6464import com .arangodb .velocypack .VPackParser ;
6565import com .arangodb .velocypack .VPackSerializer ;
6666import com .arangodb .velocypack .ValueType ;
67+ import com .arangodb .velocypack .module .jdk8 .VPackJdk8Module ;
6768import com .arangodb .velocystream .Request ;
6869import com .arangodb .velocystream .Response ;
6970
@@ -86,15 +87,16 @@ public static class Builder {
8687 private Integer maxConnections ;
8788 private final VPack .Builder vpackBuilder ;
8889 private final CollectionCache collectionCache ;
89- private final VPackParser vpackParser ;
90+ private final VPackParser . Builder vpackParser ;
9091
9192 public Builder () {
9293 super ();
9394 vpackBuilder = new VPack .Builder ();
9495 collectionCache = new CollectionCache ();
95- vpackParser = new VPackParser ();
96- VPackConfigure .configure (vpackBuilder , vpackParser , collectionCache );
97- VPackConfigureAsync .configure (vpackBuilder );
96+ vpackParser = new VPackParser .Builder ();
97+ vpackBuilder .registerModule (new VPackDriverModule (collectionCache ));
98+ vpackParser .registerModule (new VPackDriverModule (collectionCache ));
99+ vpackBuilder .registerModule (new VPackJdk8Module ());
98100 host = new Host (ArangoDBConstants .DEFAULT_HOST , ArangoDBConstants .DEFAULT_PORT );
99101 hosts = new ArrayList <>();
100102 loadProperties (ArangoDBAsync .class .getResourceAsStream (DEFAULT_PROPERTY_FILE ));
@@ -264,13 +266,23 @@ public <T extends Annotation> Builder annotationFieldNaming(
264266 return this ;
265267 }
266268
269+ public Builder registerModule (final VPackModule module ) {
270+ vpackBuilder .registerModule (module );
271+ return this ;
272+ }
273+
274+ public Builder registerModules (final VPackModule ... modules ) {
275+ vpackBuilder .registerModules (modules );
276+ return this ;
277+ }
278+
267279 public ArangoDBAsync build () {
268280 if (hosts .isEmpty ()) {
269281 hosts .add (host );
270282 }
271283 final HostHandler hostHandler = new DefaultHostHandler (hosts );
272284 return new ArangoDBAsync (asyncBuilder (hostHandler ), vpackBuilder .build (),
273- vpackBuilder .serializeNullValues (true ).build (), vpackParser , collectionCache ,
285+ vpackBuilder .serializeNullValues (true ).build (), vpackParser . build () , collectionCache ,
274286 syncBuilder (hostHandler ));
275287 }
276288
0 commit comments