public class DefaultValueIn extends Object implements ValueIn
ValueIn interface. It's primarily designed
to handle default values, converting them into various formats such as text and bytes.
It returns either null, a primitive zero or the value configured by the WireMarshaller.
This allows optional fields to be skipped without breaking deserialisation.ValueIn.Reader| Modifier and Type | Method and Description |
|---|---|
<T> T |
applyToMarshallable(Function<WireIn,T> marshallableReader)
Applies a Function to this ValueIn, interpreting it as a WireIn for a marshallable object.
|
boolean |
bool()
Reads a boolean value from the wire.
|
WireIn |
bool(@NotNull net.openhft.chronicle.core.values.BooleanValue ret)
Not implemented for default values.
|
<T> @NotNull WireIn |
bool(T t,
@NotNull net.openhft.chronicle.core.util.ObjBooleanConsumer<T> tFlag)
Reads the value as a
boolean and passes it, together with
target, to flagConsumer. |
byte[] |
bytes(byte[] using)
Populates
using with the value’s bytes when possible to avoid
allocation. |
@NotNull WireIn |
bytes(@NotNull net.openhft.chronicle.bytes.BytesOut<?> toBytes)
Reads byte data into the provided BytesOut object.
|
@NotNull WireIn |
bytes(@NotNull net.openhft.chronicle.bytes.ReadBytesMarshallable wireInConsumer)
Supplies the byte stream to
bytesMarshallable#readMarshallable for
custom deserialisation. |
@NotNull WireIn |
bytesMatch(@NotNull net.openhft.chronicle.bytes.BytesStore<?,?> compareBytes,
@NotNull net.openhft.chronicle.core.util.BooleanConsumer consumer)
Compares byte data with the provided BytesStore and uses the given BooleanConsumer based on the result.
|
@Nullable WireIn |
bytesSet(@NotNull net.openhft.chronicle.bytes.PointerBytesStore toBytes)
Sets byte data to the provided PointerBytesStore.
|
net.openhft.chronicle.core.pool.ClassLookup |
classLookup()
Retrieves a
ClassLookup instance associated with the current WireIn. |
<T> @NotNull WireIn |
date(T t,
@NotNull BiConsumer<T,LocalDate> tLocalDate)
Reads a LocalDate from the wire and applies it to a given object using the provided BiConsumer.
|
float |
float32()
Reads a 32-bit floating point number from the wire.
|
<T> @NotNull WireIn |
float32(T t,
@NotNull net.openhft.chronicle.core.util.ObjFloatConsumer<T> tf)
Reads the value as a
float and passes it to floatConsumer with
target. |
double |
float64()
Reads a 64-bit floating point number from the wire.
|
<T> @NotNull WireIn |
float64(T t,
@NotNull ObjDoubleConsumer<T> td)
Reads the value as a
double and passes it to doubleConsumer with
target. |
@NotNull BracketType |
getBracketType()
Always
BracketType.NONE as no value is read. |
boolean |
hasNext()
Always
false as no sequence exists. |
boolean |
hasNextSequenceItem()
Always
false as no sequence exists. |
short |
int16()
Reads a 16-bit integer (short) value from the wire.
|
<T> @NotNull WireIn |
int16(T t,
@NotNull net.openhft.chronicle.core.util.ObjShortConsumer<T> ti)
Reads the value as a short and passes it to
shortConsumer with target. |
int |
int32()
Reads a 32-bit integer (int) value from the wire.
|
@NotNull WireIn |
int32(@NotNull net.openhft.chronicle.core.values.IntValue value)
Reads a 32-bit integer value from the wire into the specified IntValue.
|
<T> @NotNull WireIn |
int32(@Nullable net.openhft.chronicle.core.values.IntValue value,
T t,
@NotNull BiConsumer<T,net.openhft.chronicle.core.values.IntValue> setter)
Reads a 32-bit signed integer, populates the IntValue, and applies the IntValue using the provided consumer.
|
<T> @NotNull WireIn |
int32(T t,
@NotNull ObjIntConsumer<T> ti)
Reads the value as an
int and passes it to intConsumer with
target. |
long |
int64()
Reads a 64-bit integer (long) value from the wire.
|
@NotNull WireIn |
int64(@NotNull net.openhft.chronicle.core.values.LongValue value)
Reads a 64-bit integer value from the wire into the specified LongValue.
|
<T> @NotNull WireIn |
int64(@Nullable net.openhft.chronicle.core.values.LongValue value,
T t,
@NotNull BiConsumer<T,net.openhft.chronicle.core.values.LongValue> setter)
Reads a 64-bit signed integer, populates the LongValue, and applies the LongValue using the provided consumer.
|
<T> @NotNull WireIn |
int64(T t,
@NotNull ObjLongConsumer<T> tl)
Reads the value as a
long and passes it to longConsumer with
target. |
<T> @NotNull WireIn |
int64array(@Nullable net.openhft.chronicle.core.values.LongArrayValues values,
T t,
@NotNull BiConsumer<T,net.openhft.chronicle.core.values.LongArrayValues> setter)
Not implemented for default values.
|
byte |
int8()
Reads an 8-bit integer (byte) value from the wire.
|
<T> @NotNull WireIn |
int8(T t,
@NotNull net.openhft.chronicle.core.util.ObjByteConsumer<T> tb)
Reads the value as a signed byte and passes it to
byteConsumer together with
target. |
boolean |
isNull()
Checks if the current value in the wire is null.
|
boolean |
isPresent()
Always
false; nothing was found on the wire. |
boolean |
isTyped()
Always
false. |
@Nullable Object |
marshallable(@NotNull Object object,
@NotNull SerializationStrategy strategy)
Returns
defaultValue unchanged. |
Object |
objectWithInferredType(Object using,
SerializationStrategy strategy,
Class<?> type)
Returns
defaultValue. |
long |
readLength()
Always returns
0 as no bytes are consumed. |
void |
resetState()
Resets the internal state of this ValueIn.
|
<T> boolean |
sequence(List<T> list,
@NotNull List<T> buffer,
Supplier<T> bufferAdd,
ValueIn.Reader reader0)
Always returns
false; there is no data to read. |
<T> boolean |
sequence(T t,
@NotNull BiConsumer<T,ValueIn> tReader)
Always returns
false as there is no sequence. |
<T,K> @NotNull WireIn |
sequence(T t,
K kls,
@NotNull TriConsumer<T,K,ValueIn> tReader)
Processes a sequence of values from the wire, applying a TriConsumer to each item in the sequence.
|
@NotNull WireIn |
skipValue()
Skips the current value while reading.
|
@Nullable String |
text()
Reads and returns the text data.
|
@Nullable net.openhft.chronicle.bytes.Bytes<?> |
textTo(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
Reads text data into the provided Bytes object.
|
@Nullable StringBuilder |
textTo(@NotNull StringBuilder sb)
Reads text data and appends it to the given StringBuilder.
|
<T> @NotNull WireIn |
time(T t,
@NotNull BiConsumer<T,LocalTime> setLocalTime) |
<T> T |
typedMarshallable()
Reads a typed marshallable object from the wire.
|
Type |
typeLiteral(BiFunction<CharSequence,ClassNotFoundException,Type> unresolvedHandler)
Reads a type literal from the wire, applying a handler for unresolved types.
|
<T> @NotNull WireIn |
typeLiteralAsText(T t,
@NotNull BiConsumer<T,CharSequence> ts)
Supplies a
null type prefix to ts and returns the wire. |
Class<?> |
typePrefix()
Reads the type prefix from the wire.
|
<T> @NotNull ValueIn |
typePrefix(T t,
@NotNull BiConsumer<T,CharSequence> ts)
Supplies a
null type prefix. |
int |
uint16()
Reads an unsigned 16-bit integer (represented as an int) from the wire.
|
<T> @NotNull WireIn |
uint16(T t,
@NotNull ObjIntConsumer<T> ti)
Reads the value as an unsigned short and passes it to
intConsumer with
target. |
<T> @NotNull WireIn |
uint32(T t,
@NotNull ObjLongConsumer<T> tl)
Reads the value as an unsigned int and passes it to
longConsumer with
target. |
<T> @NotNull WireIn |
uint8(T t,
@NotNull net.openhft.chronicle.core.util.ObjShortConsumer<T> ti)
Reads the value as an unsigned byte and passes it to
shortConsumer with
target. |
<T> @NotNull WireIn |
uuid(T t,
@NotNull BiConsumer<T,UUID> tuuid)
Reads a UUID from the wire and applies it to a given object using the provided BiConsumer.
|
@NotNull WireIn |
wireIn()
Provides the current WireIn instance.
|
<T> @NotNull WireIn |
zonedDateTime(T t,
@NotNull BiConsumer<T,ZonedDateTime> tZonedDateTime)
Reads a ZonedDateTime from the wire and applies it to a given object using the provided BiConsumer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitarray, array, array, array, array, array, arrayDelta, arrayDelta, asEnum, asEnum, asEnum, byteBuffer, bytes, bytes, bytesLiteral, bytesLiteral, bytesStore, character, collection, collection, date, dateTime, float32, float64, int128, int32, int64, int64ForBinding, isBinary, lenientTypeLiteral, list, list, marshallable, marshallable, marshallableAsMap, marshallableAsMap, object, object, object, object, object, object, objectBestEffort, readBoolean, readByte, readChar, readDouble, reader0, readFloat, readInt, readLong, readLong, readShort, readString, sequence, sequence, sequenceWithLength, set, set, text, text, text, throwable, time, typedMarshallable, typeLiteral, typeLiteral, typeLiteral, typePrefixOrObject, uuid, zonedDateTime@Nullable public @Nullable String text()
ValueIn@Nullable public @Nullable StringBuilder textTo(@NotNull @NotNull StringBuilder sb)
ValueIn@Nullable
public @Nullable net.openhft.chronicle.bytes.Bytes<?> textTo(@NotNull
@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
ValueIn@NotNull public @NotNull WireIn bytes(@NotNull @NotNull net.openhft.chronicle.bytes.BytesOut<?> toBytes)
ValueIn@Nullable public @Nullable WireIn bytesSet(@NotNull @NotNull net.openhft.chronicle.bytes.PointerBytesStore toBytes)
ValueIn@NotNull public @NotNull WireIn bytesMatch(@NotNull @NotNull net.openhft.chronicle.bytes.BytesStore<?,?> compareBytes, @NotNull @NotNull net.openhft.chronicle.core.util.BooleanConsumer consumer)
ValueInbytesMatch in interface ValueIncompareBytes - The BytesStore to compare with.consumer - The BooleanConsumer to be called based on the comparison result.@NotNull public @NotNull WireIn bytes(@NotNull @NotNull net.openhft.chronicle.bytes.ReadBytesMarshallable wireInConsumer)
ValueInbytesMarshallable#readMarshallable for
custom deserialisation.public byte[] bytes(byte[] using)
ValueInusing with the value’s bytes when possible to avoid
allocation. Returns the array containing the data, or null if the
value is null.@NotNull public @NotNull WireIn wireIn()
ValueInpublic long readLength()
0 as no bytes are consumed.readLength in interface ValueIn@NotNull public @NotNull WireIn skipValue()
ValueIn@NotNull public <T> @NotNull WireIn bool(T t, @NotNull @NotNull net.openhft.chronicle.core.util.ObjBooleanConsumer<T> tFlag)
ValueInboolean and passes it, together with
target, to flagConsumer.@NotNull public <T> @NotNull WireIn int8(@NotNull T t, @NotNull @NotNull net.openhft.chronicle.core.util.ObjByteConsumer<T> tb)
ValueInbyteConsumer together with
target.@NotNull public <T> @NotNull WireIn uint8(@NotNull T t, @NotNull @NotNull net.openhft.chronicle.core.util.ObjShortConsumer<T> ti)
ValueInshortConsumer with
target.@NotNull public <T> @NotNull WireIn int16(@NotNull T t, @NotNull @NotNull net.openhft.chronicle.core.util.ObjShortConsumer<T> ti)
ValueInshortConsumer with target.@NotNull public <T> @NotNull WireIn uint16(@NotNull T t, @NotNull @NotNull ObjIntConsumer<T> ti)
ValueInintConsumer with
target.@NotNull public <T> @NotNull WireIn int32(@NotNull T t, @NotNull @NotNull ObjIntConsumer<T> ti)
ValueInint and passes it to intConsumer with
target.@NotNull public <T> @NotNull WireIn uint32(@NotNull T t, @NotNull @NotNull ObjLongConsumer<T> tl)
ValueInlongConsumer with
target.@NotNull public <T> @NotNull WireIn int64(@NotNull T t, @NotNull @NotNull ObjLongConsumer<T> tl)
ValueInlong and passes it to longConsumer with
target.@NotNull public <T> @NotNull WireIn float32(@NotNull T t, @NotNull @NotNull net.openhft.chronicle.core.util.ObjFloatConsumer<T> tf)
ValueInfloat and passes it to floatConsumer with
target.@NotNull public <T> @NotNull WireIn float64(@NotNull T t, @NotNull @NotNull ObjDoubleConsumer<T> td)
ValueIndouble and passes it to doubleConsumer with
target.@NotNull public <T> @NotNull WireIn time(@NotNull T t, @NotNull @NotNull BiConsumer<T,LocalTime> setLocalTime)
@NotNull public <T> @NotNull WireIn zonedDateTime(@NotNull T t, @NotNull @NotNull BiConsumer<T,ZonedDateTime> tZonedDateTime)
ValueInzonedDateTime in interface ValueInT - The type of object to be passed to the BiConsumer.t - The object to be passed to the BiConsumer.tZonedDateTime - The BiConsumer that accepts the object and the read ZonedDateTime.@NotNull public <T> @NotNull WireIn date(@NotNull T t, @NotNull @NotNull BiConsumer<T,LocalDate> tLocalDate)
ValueInpublic boolean hasNext()
false as no sequence exists.public boolean hasNextSequenceItem()
false as no sequence exists.hasNextSequenceItem in interface ValueIn@NotNull public <T> @NotNull WireIn uuid(@NotNull T t, @NotNull @NotNull BiConsumer<T,UUID> tuuid)
ValueIn@NotNull public <T> @NotNull WireIn int64array(@Nullable @Nullable net.openhft.chronicle.core.values.LongArrayValues values, T t, @NotNull @NotNull BiConsumer<T,net.openhft.chronicle.core.values.LongArrayValues> setter)
int64array in interface ValueInT - The type of object to be passed to the BiConsumer.values - The LongArrayValues to read the data into.t - The object to be passed to the BiConsumer.setter - The BiConsumer that accepts the object and the LongArrayValues.@NotNull public @NotNull WireIn int64(@NotNull @NotNull net.openhft.chronicle.core.values.LongValue value)
ValueIn@NotNull public @NotNull WireIn int32(@NotNull @NotNull net.openhft.chronicle.core.values.IntValue value)
ValueInpublic WireIn bool(@NotNull @NotNull net.openhft.chronicle.core.values.BooleanValue ret)
@NotNull public <T> @NotNull WireIn int64(@Nullable @Nullable net.openhft.chronicle.core.values.LongValue value, T t, @NotNull @NotNull BiConsumer<T,net.openhft.chronicle.core.values.LongValue> setter)
ValueIn@NotNull public <T> @NotNull WireIn int32(@Nullable @Nullable net.openhft.chronicle.core.values.IntValue value, T t, @NotNull @NotNull BiConsumer<T,net.openhft.chronicle.core.values.IntValue> setter)
ValueInpublic <T> boolean sequence(@NotNull
T t,
@NotNull
@NotNull BiConsumer<T,ValueIn> tReader)
false as there is no sequence.public <T> boolean sequence(List<T> list, @NotNull @NotNull List<T> buffer, Supplier<T> bufferAdd, ValueIn.Reader reader0)
false; there is no data to read.sequence in interface ValueInlist - The list to store the processed items.buffer - The buffer for reusing objects.bufferAdd - Supplier to provide new instances for the buffer.reader0 - The reader that processes each item in the sequence.@NotNull public <T,K> @NotNull WireIn sequence(@NotNull T t, K kls, @NotNull @NotNull TriConsumer<T,K,ValueIn> tReader) throws net.openhft.chronicle.core.io.InvalidMarshallableException
ValueInsequence in interface ValueInT - The type of the first object to be passed to the TriConsumer.K - The type of the second object to be passed to the TriConsumer.t - The first object to be passed to the TriConsumer.kls - The second object to be passed to the TriConsumer.tReader - The TriConsumer that processes each item in the sequence.net.openhft.chronicle.core.io.InvalidMarshallableException@Nullable public <T> T applyToMarshallable(Function<WireIn,T> marshallableReader)
ValueInapplyToMarshallable in interface ValueInT - The type of the result from the Function.marshallableReader - The Function to apply to this ValueIn.@Nullable
public <T> T typedMarshallable()
throws net.openhft.chronicle.core.io.IORuntimeException
ValueIntypedMarshallable in interface ValueInnet.openhft.chronicle.core.io.IORuntimeException - if an I/O error occurs@NotNull public <T> @NotNull ValueIn typePrefix(T t, @NotNull @NotNull BiConsumer<T,CharSequence> ts)
null type prefix.typePrefix in interface ValueInT - The type of the object to apply the type prefix to.t - The object to apply the type prefix to.ts - The BiConsumer that accepts the object and the type prefix.@NotNull public <T> @NotNull WireIn typeLiteralAsText(T t, @NotNull @NotNull BiConsumer<T,CharSequence> ts) throws net.openhft.chronicle.core.io.IORuntimeException, BufferUnderflowException
null type prefix to ts and returns the wire.typeLiteralAsText in interface ValueInT - The type of the provided object.t - The object to which the type literal relates.ts - A consumer that accepts the provided object and the read class name.WireIn instance for chaining.net.openhft.chronicle.core.io.IORuntimeException - If there's an IO issue during reading.BufferUnderflowException - If there's not enough data in the buffer.public net.openhft.chronicle.core.pool.ClassLookup classLookup()
ValueInClassLookup instance associated with the current WireIn.
The ClassLookup allows for the resolution of class names to actual Class objects.classLookup in interface ValueIn@Nullable public @Nullable Object marshallable(@NotNull @NotNull Object object, @NotNull @NotNull SerializationStrategy strategy) throws BufferUnderflowException, net.openhft.chronicle.core.io.IORuntimeException
defaultValue unchanged.marshallable in interface ValueInobject - The object to populate with the marshallable data.strategy - The SerializationStrategy to use for reading the marshallable data.BufferUnderflowException - if the buffer underflows while readingnet.openhft.chronicle.core.io.IORuntimeException - if an I/O error occurspublic boolean bool()
throws net.openhft.chronicle.core.io.IORuntimeException
ValueInpublic byte int8()
ValueInpublic short int16()
ValueInpublic int uint16()
ValueInpublic int int32()
ValueInpublic long int64()
ValueInpublic double float64()
ValueInpublic float float32()
ValueInpublic Type typeLiteral(BiFunction<CharSequence,ClassNotFoundException,Type> unresolvedHandler)
ValueIntypeLiteral in interface ValueInunresolvedHandler - The handler to apply for unresolved types.@NotNull public @NotNull BracketType getBracketType()
BracketType.NONE as no value is read.getBracketType in interface ValueInpublic boolean isNull()
ValueInpublic Object objectWithInferredType(Object using, SerializationStrategy strategy, Class<?> type)
defaultValue.objectWithInferredType in interface ValueInusing - An instance of the object to reuse, or null to create a new instance.strategy - The SerializationStrategy to use for reading the object.type - The type of the object to read.public boolean isPresent()
false; nothing was found on the wire.public boolean isTyped()
false.public Class<?> typePrefix()
ValueIntypePrefix in interface ValueInpublic void resetState()
ValueInresetState in interface ValueInCopyright © 2026 Chronicle Software Ltd. All rights reserved.