public class WireMarshaller<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
static net.openhft.chronicle.core.ClassLocal<WireMarshaller> |
WIRE_MARSHALLER_CL |
| Modifier | Constructor and Description |
|---|---|
protected |
WireMarshaller(@NotNull Class<T> tClass,
@NotNull net.openhft.chronicle.wire.WireMarshaller.FieldAccess[] fields,
boolean isLeaf) |
| Modifier and Type | Method and Description |
|---|---|
T |
defaultValue() |
WireMarshaller<T> |
excludeFields(String... fieldNames) |
static void |
getAllField(@NotNull Class clazz,
@NotNull Map<String,Field> map) |
Object |
getField(Object o,
String name) |
long |
getLongField(@NotNull Object o,
String name) |
boolean |
isEqual(Object o1,
Object o2) |
boolean |
isLeaf() |
protected static boolean |
leafable(net.openhft.chronicle.wire.WireMarshaller.FieldAccess c) |
boolean |
matchesFieldName(StringBuilder sb,
net.openhft.chronicle.wire.WireMarshaller.FieldAccess field) |
static <T> @NotNull WireMarshaller<T> |
of(@NotNull Class<T> tClass) |
void |
readMarshallable(T t,
@NotNull WireIn in,
T defaults,
boolean overwrite)
Reads and populates the DTO based on the provided input.
|
void |
readMarshallableDTOOrder(T t,
@NotNull WireIn in,
T defaults,
boolean overwrite)
Reads and populates the DTO based on the provided order.
|
void |
readMarshallableInputOrder(T t,
@NotNull WireIn in,
T defaults,
boolean overwrite)
Reads and populates the DTO based on the input's order.
|
void |
reset(T o) |
void |
setField(Object o,
String name,
Object value) |
void |
setLongField(Object o,
String name,
long value) |
void |
writeKey(T t,
net.openhft.chronicle.bytes.Bytes<?> bytes) |
void |
writeMarshallable(T t,
net.openhft.chronicle.bytes.Bytes<?> bytes) |
void |
writeMarshallable(T t,
@NotNull WireOut out) |
void |
writeMarshallable(T t,
@NotNull WireOut out,
T previous,
boolean copy)
Writes the values of the fields from the provided object (DTO) to the output.
|
public static final net.openhft.chronicle.core.ClassLocal<WireMarshaller> WIRE_MARSHALLER_CL
@NotNull public static <T> @NotNull WireMarshaller<T> of(@NotNull @NotNull Class<T> tClass)
protected static boolean leafable(net.openhft.chronicle.wire.WireMarshaller.FieldAccess c)
public static void getAllField(@NotNull
@NotNull Class clazz,
@NotNull
@NotNull Map<String,Field> map)
public WireMarshaller<T> excludeFields(String... fieldNames)
public void writeMarshallable(T t, @NotNull @NotNull WireOut out) throws net.openhft.chronicle.core.io.InvalidMarshallableException
net.openhft.chronicle.core.io.InvalidMarshallableExceptionpublic void writeMarshallable(T t, net.openhft.chronicle.bytes.Bytes<?> bytes)
public void writeMarshallable(T t, @NotNull @NotNull WireOut out, T previous, boolean copy) throws net.openhft.chronicle.core.io.InvalidMarshallableException
t - Object whose field values are to be written.out - Output destination where the field values are written to.previous - Previous object to compare for optional copying.copy - Flag indicating whether to copy values from the source object to the previous object.net.openhft.chronicle.core.io.InvalidMarshallableException - If there's an error during marshalling.public void readMarshallable(T t, @NotNull @NotNull WireIn in, T defaults, boolean overwrite) throws net.openhft.chronicle.core.io.InvalidMarshallableException
t - Object to populate with read values.in - Input source from which values are read.defaults - Default values to use if a value isn't provided in the input.overwrite - Flag indicating whether to overwrite the existing value in the target object.net.openhft.chronicle.core.io.InvalidMarshallableException - If there is an error during marshalling.public void readMarshallableDTOOrder(T t, @NotNull @NotNull WireIn in, T defaults, boolean overwrite) throws net.openhft.chronicle.core.io.InvalidMarshallableException
t - Target object to populate with read values.in - Input source from which values are read.defaults - Default values to use if a value isn't provided in the input.overwrite - Flag indicating whether to overwrite the existing value in the target object.net.openhft.chronicle.core.io.InvalidMarshallableException - If there is an error during marshalling.public void readMarshallableInputOrder(T t, @NotNull @NotNull WireIn in, T defaults, boolean overwrite) throws net.openhft.chronicle.core.io.InvalidMarshallableException
t - Target object to populate with read values.in - Input source from which values are read.defaults - Default values to use if a value isn't provided in the input.overwrite - Flag indicating whether to overwrite the existing value in the target object.net.openhft.chronicle.core.io.InvalidMarshallableException - If there is an error during marshalling.public boolean matchesFieldName(StringBuilder sb, net.openhft.chronicle.wire.WireMarshaller.FieldAccess field)
public void writeKey(T t, net.openhft.chronicle.bytes.Bytes<?> bytes)
public Object getField(Object o, String name) throws NoSuchFieldException
NoSuchFieldExceptionpublic long getLongField(@NotNull
@NotNull Object o,
String name)
throws NoSuchFieldException
NoSuchFieldExceptionpublic void setField(Object o, String name, Object value) throws NoSuchFieldException
NoSuchFieldExceptionpublic void setLongField(Object o, String name, long value) throws NoSuchFieldException
NoSuchFieldException@Nullable public T defaultValue()
public void reset(T o)
public boolean isLeaf()
Copyright © 2023. All rights reserved.