Elffuss BraidHub

kikocis/java-driver public

Add copy constructor to Configuration class.
Changeset1eddbb93fc67a301c66a3970f1c8732364be852b2f4a1775ace62aa73e0ee897
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-23 17:15 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2016-01-06 10:37 +01:00
Parents58da2e52b28d

Browse the files at this changeset

1 file changed

modified driver-core/src/main/java/com/datastax/driver/core/Configuration.java +18 −0
@@ -72,6 +72,24 @@
7272 this.codecRegistry = codecRegistry;
7373 }
7474
75+ /**
76+ * Copy constructor.
77+ *
78+ * @param toCopy the object to copy from.
79+ */
80+ protected Configuration(Configuration toCopy) {
81+ this(
82+ toCopy.getPolicies(),
83+ toCopy.getProtocolOptions(),
84+ toCopy.getPoolingOptions(),
85+ toCopy.getSocketOptions(),
86+ toCopy.getMetricsOptions(),
87+ toCopy.getQueryOptions(),
88+ toCopy.getNettyOptions(),
89+ toCopy.getCodecRegistry()
90+ );
91+ }
92+
7593 void register(Cluster.Manager manager) {
7694 protocolOptions.register(manager);
7795 poolingOptions.register(manager);