use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class DeserializedGenericRecord method getArrayOfNullableFloat64.
@Nullable
@Override
public Double[] getArrayOfNullableFloat64(@Nonnull String fieldName) {
FieldKind fieldKind = check(fieldName, ARRAY_OF_FLOAT64, ARRAY_OF_NULLABLE_FLOAT64);
if (fieldKind == ARRAY_OF_FLOAT64) {
double[] array = (double[]) objects.get(fieldName);
Double[] result = new Double[array.length];
Arrays.setAll(result, i -> array[i]);
return result;
}
return (Double[]) objects.get(fieldName);
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class DeserializedGenericRecord method getArrayOfNullableInt8.
@Nullable
@Override
public Byte[] getArrayOfNullableInt8(@Nonnull String fieldName) {
FieldKind fieldKind = check(fieldName, ARRAY_OF_INT8, ARRAY_OF_NULLABLE_INT8);
if (fieldKind == ARRAY_OF_INT8) {
byte[] array = (byte[]) objects.get(fieldName);
Byte[] result = new Byte[array.length];
Arrays.setAll(result, i -> array[i]);
return result;
}
return (Byte[]) objects.get(fieldName);
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class DeserializedGenericRecord method getArrayOfFloat32.
@Override
@Nullable
public float[] getArrayOfFloat32(@Nonnull String fieldName) {
FieldKind fieldKind = check(fieldName, ARRAY_OF_FLOAT32, ARRAY_OF_NULLABLE_FLOAT32);
if (fieldKind == ARRAY_OF_NULLABLE_FLOAT32) {
Float[] array = (Float[]) objects.get(fieldName);
float[] result = new float[array.length];
for (int i = 0; i < array.length; i++) {
if (array[i] == null) {
throw exceptionForUnexpectedNullValueInArray(fieldName, "Float32");
}
result[i] = array[i];
}
return result;
}
return (float[]) objects.get(fieldName);
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class DeserializedGenericRecord method getArrayOfNullableBoolean.
@Nullable
@Override
public Boolean[] getArrayOfNullableBoolean(@Nonnull String fieldName) {
FieldKind fieldKind = check(fieldName, ARRAY_OF_BOOLEAN, ARRAY_OF_NULLABLE_BOOLEAN);
if (fieldKind == ARRAY_OF_BOOLEAN) {
boolean[] array = (boolean[]) objects.get(fieldName);
Boolean[] result = new Boolean[array.length];
Arrays.setAll(result, i -> array[i]);
return result;
}
return (Boolean[]) objects.get(fieldName);
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class DeserializedGenericRecord method getArrayOfNullableInt16.
@Nullable
@Override
public Short[] getArrayOfNullableInt16(@Nonnull String fieldName) {
FieldKind fieldKind = check(fieldName, ARRAY_OF_INT16, ARRAY_OF_NULLABLE_INT16);
if (fieldKind == ARRAY_OF_INT16) {
short[] array = (short[]) objects.get(fieldName);
Short[] result = new Short[array.length];
Arrays.setAll(result, i -> array[i]);
return result;
}
return (Short[]) objects.get(fieldName);
}
Aggregations