public final class ConfigurationSerialization extends Object
Configuration.
Synchronized with the commit on 23-April-2019.| 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 arguments into a new instance of the
given class.
|
static @Nullable ConfigurationSerializable |
deserializeObject(@NotNull Map<String,?> map,
@NotNull Class<? extends ConfigurationSerializable> clazz)
|
static @NotNull String |
getAlias(@NotNull Class<? extends ConfigurationSerializable> clazz)
Gets the primary alias for the given
ConfigurationSerializable
Class. |
static @Nullable Class<? extends ConfigurationSerializable> |
getClassByAlias(@NotNull String alias)
Attempts to get a registered
ConfigurationSerializable
Class by its alias. |
static void |
registerClass(@NotNull Class<? extends ConfigurationSerializable> clazz)
Registers the given
ConfigurationSerializable Class by
its alias. |
static void |
registerClass(@NotNull Class<? extends ConfigurationSerializable> clazz,
@NotNull String alias)
Registers the given alias to the specified
ConfigurationSerializable Class |
static void |
unregisterClass(@NotNull Class<? extends ConfigurationSerializable> clazz)
Unregisters any aliases for the specified
ConfigurationSerializable Class. |
static void |
unregisterClass(@NotNull String alias)
Unregisters the specified alias from a
ConfigurationSerializable. |
public static final String SERIALIZED_TYPE_KEY
@Nullable public static @Nullable ConfigurationSerializable deserializeObject(@NotNull @NotNull Map<String,?> map, @NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
Map into a new instance of the
given Class.
The Class must implement ConfigurationSerializable,
including the extra methods as specified in the javadoc of a
ConfigurationSerializable.
If a new instance could not be made (an example being the Class
not fully implementing the interface), null will be returned.
@Nullable public static @Nullable ConfigurationSerializable deserializeObject(@NotNull @NotNull Map<String,?> map)
The class must implement ConfigurationSerializable, including
the extra methods as specified in the javadoc of
ConfigurationSerializable.
If a new instance could not be made, an example being the class not fully implementing the interface, null will be returned.
map - The data as a Map to deserialize.ConfigurationSerializable with the data from the
given Map.public static void registerClass(@NotNull
@NotNull Class<? extends ConfigurationSerializable> clazz)
ConfigurationSerializable Class by
its alias.clazz - The Class to register.public static void registerClass(@NotNull
@NotNull Class<? extends ConfigurationSerializable> clazz,
@NotNull
@NotNull String alias)
ConfigurationSerializable Classclazz - The Class to register.alias - Alias to register the Class as.SerializableAspublic static void unregisterClass(@NotNull
@NotNull String alias)
ConfigurationSerializable.alias - The alias to unregister.public static void unregisterClass(@NotNull
@NotNull Class<? extends ConfigurationSerializable> clazz)
ConfigurationSerializable Class.clazz - The Class to unregister.@Nullable public static @Nullable Class<? extends ConfigurationSerializable> getClassByAlias(@NotNull @NotNull String alias)
ConfigurationSerializable
Class by its alias.alias - The alias of the ConfigurationSerializable to
retrieve.ConfigurationSerializable, or null
if one is not found.@NotNull public static @NotNull String getAlias(@NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
ConfigurationSerializable
Class.clazz - The Class to retrieve the alias of.ConfigurationSerializable.Copyright © 2022 BSPF Systems, LLC. All rights reserved.