Class Configuration<T>
java.lang.Object
me.bristermitten.mittenlib.config.Configuration<T>
- Type Parameters:
T- the type of the config
Represents a loadable configuration which will deserialize to an object of type
Configuration-
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(String fileName, Class<T> type, @Nullable DeserializationFunction<T> deserializeFunction) Create a new ConfigurationConfiguration(String fileName, Class<T> type, @Nullable DeserializationFunction<T> deserializeFunction, @Nullable SerializationFunction<T> serializeFunction) Create a new Configuration -
Method Summary
Modifier and TypeMethodDescription@Nullable DeserializationFunction<T> Returns the function to use to deserialize the data.Returns the name of the file to load.@Nullable SerializationFunction<T> Returns the function to use to serialize the data.getType()Returns the type to deserialize to.
-
Constructor Details
-
Configuration
public Configuration(String fileName, Class<T> type, @Nullable @Nullable DeserializationFunction<T> deserializeFunction) Create a new Configuration- Parameters:
fileName- the name of the file to loadtype- the type to deserialize todeserializeFunction- the function to use to deserialize the data
-
Configuration
public Configuration(String fileName, Class<T> type, @Nullable @Nullable DeserializationFunction<T> deserializeFunction, @Nullable @Nullable SerializationFunction<T> serializeFunction) Create a new Configuration- Parameters:
fileName- the name of the file to loadtype- the type to deserialize todeserializeFunction- the function to use to deserialize the dataserializeFunction- the function to use to serialize the data
-
-
Method Details
-
getFileName
Returns the name of the file to load.- Returns:
- the name of the file to load
-
getType
Returns the type to deserialize to.- Returns:
- the type to deserialize to
-
getDeserializeFunction
Returns the function to use to deserialize the data.- Returns:
- the function to use to deserialize the data
-
getSerializeFunction
Returns the function to use to serialize the data.- Returns:
- the function to use to serialize the data
-