Package com.illumon.integrations.common
Class PrimitiveArrayConversionUtility
java.lang.Object
com.illumon.integrations.common.PrimitiveArrayConversionUtility
General purpose helper methods for array conversion methods from specific object types to/from primitive types.
This is specifically intended to improve performance in integration with Python, where conversion of primitive
type arrays involves direct copy of a memory buffer, and is much more performant than element-by-element inspection.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]translateArrayBooleanToByte(Boolean[] array) Translates a java.lang.Boolean array to a byte array.static Boolean[]translateArrayByteToBoolean(byte[] array) Translates a byte array to a Boolean array.static long[]translateArrayDBDateTimeToLong(DBDateTime[] array) Translates a DBDateTime array to a long array.static DBDateTime[]translateArrayLongToDBDateTime(long[] array) Translates a long array to a DBDateTime array.
-
Constructor Details
-
PrimitiveArrayConversionUtility
public PrimitiveArrayConversionUtility()
-
-
Method Details
-
translateArrayBooleanToByte
Translates a java.lang.Boolean array to a byte array. The mapping will be performed as null to -1, false to 0, and true to 1. This is the (psuedo)inverse of `translateArrayByteToBoolean`.- Parameters:
array- - the Boolean array- Returns:
- the byte array
-
translateArrayByteToBoolean
Translates a byte array to a Boolean array. The mapping will be performed as <0 to null, 0 to false, >0 to true. This is the (psuedo)inverse of `translateArrayBooleanToByte`.- Parameters:
array- - the byte array- Returns:
- the Boolean array
-
translateArrayDBDateTimeToLong
Translates a DBDateTime array to a long array. This is the (psuedo)inverse of `translateArrayLongToDBDateTime`.- Parameters:
array- - the DBDateTime array- Returns:
- the corresponding long array
-
translateArrayLongToDBDateTime
Translates a long array to a DBDateTime array. This is the (psuedo)inverse of `translateArrayLongToDBDateTime`.- Parameters:
array- - the long array- Returns:
- the corresponding DBDateTime array
-