public final class ObjectConverter
extends java.lang.Object
| Constructor and Description |
|---|
ObjectConverter()
Creates a new ObjectConverter with the default parameters.
|
ObjectConverter(boolean bypassTransient,
boolean bypassFinal)
Creates a new ObjectConverter with advanced parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
toConfig(java.lang.Class<?> clazz,
Config destination) |
<C extends Config> |
toConfig(java.lang.Class<?> clazz,
java.util.function.Supplier<C> destinationSupplier) |
void |
toConfig(java.lang.Object o,
Config destination)
Converts an Object to a Config.
|
<C extends Config> |
toConfig(java.lang.Object o,
java.util.function.Supplier<C> destinationSupplier)
Converts an Object to a Config.
|
void |
toObject(UnmodifiableConfig config,
java.lang.Object destination)
Converts a Config to an Object.
|
<O> O |
toObject(UnmodifiableConfig config,
java.util.function.Supplier<O> destinationSupplier)
Converts a Config to an Object.
|
public ObjectConverter(boolean bypassTransient,
boolean bypassFinal)
bypassTransient - true to use (parse or write) a field even if it's transientbypassFinal - true to write a field even if it's finalpublic ObjectConverter()
new ObjectConverter(false, true).ObjectConverter(boolean, boolean)public void toConfig(java.lang.Object o,
Config destination)
o - the object to convertdestination - the Config where to put the values intopublic void toConfig(java.lang.Class<?> clazz,
Config destination)
public <C extends Config> C toConfig(java.lang.Object o, java.util.function.Supplier<C> destinationSupplier)
C - the destination's typeo - the object to convertdestinationSupplier - a Supplier that provides the Config where to put the values intopublic <C extends Config> C toConfig(java.lang.Class<?> clazz, java.util.function.Supplier<C> destinationSupplier)
public void toObject(UnmodifiableConfig config, java.lang.Object destination)
config - the config to convertdestination - the Object where to put the values intopublic <O> O toObject(UnmodifiableConfig config, java.util.function.Supplier<O> destinationSupplier)
O - the destination's typeconfig - the config to convertdestinationSupplier - a Supplier that provides the Object where to put the values into