public class ConfigurationSerialization extends Object
Configuration
.Modifier and Type | Field and Description |
---|---|
static String |
SERIALIZED_TYPE_KEY |
Modifier | Constructor and Description |
---|---|
protected |
ConfigurationSerialization(@NotNull Class<? extends ConfigurationSerializable> clazz) |
public static final String SERIALIZED_TYPE_KEY
protected ConfigurationSerialization(@NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
@Nullable protected @Nullable Method getMethod(@NotNull @NotNull String name, boolean isStatic)
@Nullable protected @Nullable Constructor<? extends ConfigurationSerializable> getConstructor()
@Nullable protected @Nullable ConfigurationSerializable deserializeViaMethod(@NotNull @NotNull Method method, @NotNull @NotNull Map<String,?> args)
@Nullable protected @Nullable ConfigurationSerializable deserializeViaCtor(@NotNull @NotNull Constructor<? extends ConfigurationSerializable> ctor, @NotNull @NotNull Map<String,?> args)
@Nullable public @Nullable ConfigurationSerializable deserialize(@NotNull @NotNull Map<String,?> args)
@Nullable public static @Nullable ConfigurationSerializable deserializeObject(@NotNull @NotNull Map<String,?> args, @NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
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.
args
- Arguments for deserializationclazz
- Class to deserialize into@Nullable public static @Nullable ConfigurationSerializable deserializeObject(@NotNull @NotNull Map<String,?> args)
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.
args
- Arguments for deserializationpublic static void registerClass(@NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
ConfigurationSerializable
class by its
aliasclazz
- Class to registerpublic static void registerClass(@NotNull @NotNull Class<? extends ConfigurationSerializable> clazz, @NotNull @NotNull String alias)
ConfigurationSerializable
classclazz
- Class to registeralias
- Alias to register asSerializableAs
public static void unregisterClass(@NotNull @NotNull String alias)
ConfigurationSerializable
alias
- Alias to unregisterpublic static void unregisterClass(@NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
ConfigurationSerializable
classclazz
- Class to unregister@Nullable public static @Nullable Class<? extends ConfigurationSerializable> getClassByAlias(@NotNull @NotNull String alias)
ConfigurationSerializable
class by
its aliasalias
- Alias of the serializable@NotNull public static @NotNull String getAlias(@NotNull @NotNull Class<? extends ConfigurationSerializable> clazz)
ConfigurationSerializable
classclazz
- Class to get alias forCopyright © 2021. All rights reserved.