public final class ConfigurationSerialization extends Object
Synchronized with the commit on 19-November-2023.
| Modifier and Type | Field and Description |
|---|---|
static String |
SERIALIZED_TYPE_KEY |
| Modifier and Type | Method and Description |
|---|---|
static @Nullable ConfigurationSerializable |
deserializeObject(@NotNull Map<String,?> map)
Attempts to deserialize the given map into a new instance of any known
type of configuration serializable that may be indicated by the data
contained within the map itself.
|
static @Nullable ConfigurationSerializable |
deserializeObject(@NotNull Map<String,?> map,
@NotNull Class<? extends ConfigurationSerializable> clazz)
Attempts to deserialize the given map into a new instance of the given
class.
|
static @NotNull String |
getAlias(@NotNull Class<? extends ConfigurationSerializable> clazz)
Gets the primary alias for the given configuration serializable class.
|
static @Nullable Class<? extends ConfigurationSerializable> |
getClassByAlias(@NotNull String alias)
Attempts to get a registered configuration serializable class by its
alias.
|
static void |
registerClass(@NotNull Class<? extends ConfigurationSerializable> clazz)
Registers the given configuration serializable class by any and all
aliases/delegate deserializations.
|
static void |
registerClass(@NotNull Class<? extends ConfigurationSerializable> clazz,
@NotNull String alias)
Registers the given alias to the given configuration serializable class.
|
static void |
unregisterClass(@NotNull Class<? extends ConfigurationSerializable> clazz)
Unregisters any aliases for the given configuration serializable class
|
static void |
unregisterClass(@NotNull String alias)
Unregisters the specified alias.
|
public static final String SERIALIZED_TYPE_KEY
@Nullable public static @Nullable ConfigurationSerializable deserializeObject(@NotNull @NotNull Map<String,?> map, @NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
The class must implement configuration serializable, including the extra methods and/or constructor as specified in the javadocs of a configuration serializable.
If a new instance could not be made (an example being the class not fully
implementing the interface), null will be returned.
map - The map to deserialize.clazz - The class to deserialize into.@Nullable public static @Nullable ConfigurationSerializable deserializeObject(@NotNull @NotNull Map<String,?> map)
The class must implement configuration serializable, including the extra methods and/or constructor as specified in the javadocs of a configuration serializable.
If a new instance could not be made (an example being the class not fully
implementing the interface), null will be returned.
map - The map to deserialize.public static void registerClass(@NotNull
@NotNull Class<? extends ConfigurationSerializable> clazz)
clazz - The class to register.public static void registerClass(@NotNull
@NotNull Class<? extends ConfigurationSerializable> clazz,
@NotNull
@NotNull String alias)
clazz - The class to register.alias - Alias to register the class as.SerializableAspublic static void unregisterClass(@NotNull
@NotNull String alias)
alias - The alias to unregister.public static void unregisterClass(@NotNull
@NotNull Class<? extends ConfigurationSerializable> clazz)
clazz - The class to unregister.@Nullable public static @Nullable Class<? extends ConfigurationSerializable> getClassByAlias(@NotNull @NotNull String alias)
alias - The alias of the configuration serializable to retrieve.null if one
is not found.@NotNull public static @NotNull String getAlias(@NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
clazz - The class to retrieve the primary alias of.Copyright © 2024 BSPF Systems, LLC. All rights reserved.