use of com.hazelcast.nio.ObjectDataInput 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.ObjectDataInput 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.ObjectDataInput 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.ObjectDataInput 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);
}
}
use of com.hazelcast.nio.ObjectDataInput in project hazelcast by hazelcast.
the class CompactInternalGenericRecord method getNullableInt64.
@Nullable
@Override
public Long getNullableInt64(@Nonnull String fieldName) {
FieldDescriptor fd = getFieldDefinition(fieldName);
FieldKind fieldKind = fd.getKind();
switch(fieldKind) {
case INT64:
try {
return in.readLong(readFixedSizePosition(fd));
} catch (IOException e) {
throw illegalStateException(e);
}
case NULLABLE_INT64:
return getVariableSize(fd, ObjectDataInput::readLong);
default:
throw unexpectedFieldKind(fieldKind, fieldName);
}
}
Aggregations