use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class CompactInternalGenericRecord method getInt16.
@Override
public short getInt16(@Nonnull String fieldName) {
FieldDescriptor fd = getFieldDefinition(fieldName);
FieldKind fieldKind = fd.getKind();
switch(fieldKind) {
case INT16:
try {
return in.readShort(readFixedSizePosition(fd));
} catch (IOException e) {
throw illegalStateException(e);
}
case NULLABLE_INT16:
return getVariableSizeAsNonNull(fd, ObjectDataInput::readShort, "Int16");
default:
throw unexpectedFieldKind(fieldKind, fieldName);
}
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class CompactInternalGenericRecord method getNullableInt8.
@Nullable
@Override
public Byte getNullableInt8(@Nonnull String fieldName) {
FieldDescriptor fd = getFieldDefinition(fieldName);
FieldKind fieldKind = fd.getKind();
switch(fieldKind) {
case INT8:
try {
return in.readByte(readFixedSizePosition(fd));
} catch (IOException e) {
throw illegalStateException(e);
}
case NULLABLE_INT8:
return getVariableSize(fd, ObjectDataInput::readByte);
default:
throw unexpectedFieldKind(fieldKind, fieldName);
}
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class CompactInternalGenericRecord method getNullableFloat32.
@Nullable
@Override
public Float getNullableFloat32(@Nonnull String fieldName) {
FieldDescriptor fd = getFieldDefinition(fieldName);
FieldKind fieldKind = fd.getKind();
switch(fieldKind) {
case FLOAT32:
try {
return in.readFloat(readFixedSizePosition(fd));
} catch (IOException e) {
throw illegalStateException(e);
}
case NULLABLE_FLOAT32:
return getVariableSize(fd, ObjectDataInput::readFloat);
default:
throw unexpectedFieldKind(fieldKind, fieldName);
}
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class CompactInternalGenericRecord method getNullableBoolean.
@Nullable
@Override
public Boolean getNullableBoolean(@Nonnull String fieldName) {
FieldDescriptor fd = getFieldDefinition(fieldName);
FieldKind fieldKind = fd.getKind();
switch(fieldKind) {
case BOOLEAN:
return getBoolean(fd);
case NULLABLE_BOOLEAN:
return getVariableSize(fd, ObjectDataInput::readBoolean);
default:
throw unexpectedFieldKind(fieldKind, fieldName);
}
}
use of com.hazelcast.nio.serialization.FieldKind in project hazelcast by hazelcast.
the class CompactInternalGenericRecord method getFloat64.
@Override
public double getFloat64(@Nonnull String fieldName) {
FieldDescriptor fd = getFieldDefinition(fieldName);
FieldKind fieldKind = fd.getKind();
switch(fieldKind) {
case FLOAT64:
try {
return in.readDouble(readFixedSizePosition(fd));
} catch (IOException e) {
throw illegalStateException(e);
}
case NULLABLE_FLOAT64:
return getVariableSizeAsNonNull(fd, ObjectDataInput::readDouble, "Float64");
default:
throw unexpectedFieldKind(fieldKind, fieldName);
}
}
Aggregations