9090 *
9191 * <p>The main goal of this class is to move this code out of the request handlers.
9292 */
93- class Conversions {
93+ public class Conversions {
9494
95- static Message toMessage (
95+ public static Message toMessage (
9696 Statement <?> statement , DriverConfigProfile config , InternalDriverContext context ) {
9797 int consistency =
9898 context
@@ -174,7 +174,7 @@ static Message toMessage(
174174 }
175175 List <Object > queriesOrIds = new ArrayList <>(batchStatement .size ());
176176 List <List <ByteBuffer >> values = new ArrayList <>(batchStatement .size ());
177- for (BatchableStatement child : batchStatement ) {
177+ for (BatchableStatement <?> child : batchStatement ) {
178178 if (child instanceof SimpleStatement ) {
179179 SimpleStatement simpleStatement = (SimpleStatement ) child ;
180180 if (simpleStatement .getNamedValues ().size () > 0 ) {
@@ -209,7 +209,7 @@ static Message toMessage(
209209 }
210210 }
211211
212- private static List <ByteBuffer > encode (
212+ public static List <ByteBuffer > encode (
213213 List <Object > values , CodecRegistry codecRegistry , ProtocolVersion protocolVersion ) {
214214 if (values .isEmpty ()) {
215215 return Collections .emptyList ();
@@ -222,7 +222,7 @@ private static List<ByteBuffer> encode(
222222 }
223223 }
224224
225- private static Map <String , ByteBuffer > encode (
225+ public static Map <String , ByteBuffer > encode (
226226 Map <String , Object > values , CodecRegistry codecRegistry , ProtocolVersion protocolVersion ) {
227227 if (values .isEmpty ()) {
228228 return Collections .emptyMap ();
@@ -235,7 +235,7 @@ private static Map<String, ByteBuffer> encode(
235235 }
236236 }
237237
238- private static ByteBuffer encode (
238+ public static ByteBuffer encode (
239239 Object value , CodecRegistry codecRegistry , ProtocolVersion protocolVersion ) {
240240 if (value instanceof Token ) {
241241 if (value instanceof Murmur3Token ) {
@@ -252,7 +252,7 @@ private static ByteBuffer encode(
252252 }
253253 }
254254
255- private static void ensureAllSet (BoundStatement boundStatement ) {
255+ public static void ensureAllSet (BoundStatement boundStatement ) {
256256 for (int i = 0 ; i < boundStatement .size (); i ++) {
257257 if (!boundStatement .isSet (i )) {
258258 throw new IllegalStateException (
@@ -264,15 +264,15 @@ private static void ensureAllSet(BoundStatement boundStatement) {
264264 }
265265 }
266266
267- private static void ensureAllSet (BatchStatement batchStatement ) {
267+ public static void ensureAllSet (BatchStatement batchStatement ) {
268268 for (BatchableStatement <?> batchableStatement : batchStatement ) {
269269 if (batchableStatement instanceof BoundStatement ) {
270270 ensureAllSet (((BoundStatement ) batchableStatement ));
271271 }
272272 }
273273 }
274274
275- static AsyncResultSet toResultSet (
275+ public static AsyncResultSet toResultSet (
276276 Result result ,
277277 ExecutionInfo executionInfo ,
278278 CqlSession session ,
@@ -292,7 +292,7 @@ static AsyncResultSet toResultSet(
292292 }
293293 }
294294
295- private static ColumnDefinitions getResultDefinitions (
295+ public static ColumnDefinitions getResultDefinitions (
296296 Rows rows , Statement <?> statement , InternalDriverContext context ) {
297297 RowsMetadata rowsMetadata = rows .getMetadata ();
298298 if (rowsMetadata .columnSpecs .isEmpty ()) {
@@ -315,7 +315,7 @@ private static ColumnDefinitions getResultDefinitions(
315315 }
316316 }
317317
318- static DefaultPreparedStatement toPreparedStatement (
318+ public static DefaultPreparedStatement toPreparedStatement (
319319 Prepared response , PrepareRequest request , InternalDriverContext context ) {
320320 return new DefaultPreparedStatement (
321321 ByteBuffer .wrap (response .preparedQueryId ).asReadOnlyBuffer (),
@@ -336,7 +336,7 @@ static DefaultPreparedStatement toPreparedStatement(
336336 ImmutableMap .copyOf (request .getCustomPayload ()));
337337 }
338338
339- private static ColumnDefinitions toColumnDefinitions (
339+ public static ColumnDefinitions toColumnDefinitions (
340340 RowsMetadata metadata , InternalDriverContext context ) {
341341 ImmutableList .Builder <ColumnDefinition > definitions = ImmutableList .builder ();
342342 for (ColumnSpec columnSpec : metadata .columnSpecs ) {
@@ -345,7 +345,7 @@ private static ColumnDefinitions toColumnDefinitions(
345345 return DefaultColumnDefinitions .valueOf (definitions .build ());
346346 }
347347
348- private static List <Integer > asList (int [] pkIndices ) {
348+ public static List <Integer > asList (int [] pkIndices ) {
349349 if (pkIndices == null || pkIndices .length == 0 ) {
350350 return Collections .emptyList ();
351351 } else {
@@ -357,7 +357,7 @@ private static List<Integer> asList(int[] pkIndices) {
357357 }
358358 }
359359
360- static CoordinatorException toThrowable (
360+ public static CoordinatorException toThrowable (
361361 Node node , Error errorMessage , InternalDriverContext context ) {
362362 switch (errorMessage .code ) {
363363 case ProtocolConstants .ErrorCode .UNPREPARED :
0 commit comments