public interface Demarshallable
Unlike the `ReadMarshallable` pattern, the `Demarshallable` interface mandates that implementing classes provide a constructor taking a `WireIn` instance to enable deserialization. This approach ensures a clear mechanism to obtain a new object instance from the serialized data. The interface also provides a utility to instantiate objects of implementing classes using the appropriate constructor.
| Modifier and Type | Field and Description |
|---|---|
static ClassValue<Constructor<Demarshallable>> |
DEMARSHALLABLES |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Demarshallable> |
newInstance(@NotNull Class<T> clazz,
WireIn wireIn)
Provides a utility method to create a new instance of a class that implements the `Demarshallable` interface.
|
static final ClassValue<Constructor<Demarshallable>> DEMARSHALLABLES
@NotNull static <T extends Demarshallable> T newInstance(@NotNull @NotNull Class<T> clazz, WireIn wireIn)
T - The type of the object to be returned, which should implement `Demarshallable`.clazz - The class type to be instantiated.wireIn - The `WireIn` parameter to be passed to the constructor for deserialization.Copyright © 2024. All rights reserved.