Skip to content

Commit 9d91731

Browse files
committed
IConfiguration interface added for configurations.
Signed-off-by: Pavel Erokhin (MairwunNx) <[email protected]>
1 parent fd8ff82 commit 9d91731

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.mairwunnx.projectessentials.core.configuration
2+
3+
/**
4+
* Configuration interface for all configuration
5+
* in project essentials modules.
6+
*
7+
* @param T configuration data class.
8+
*
9+
* @since 1.14.4-1.3.0
10+
*/
11+
interface IConfiguration<T> {
12+
/**
13+
* Configuration instance (must initialized in
14+
* `load` method).
15+
*
16+
* @since 1.14.4-1.3.0
17+
*/
18+
val configuration: T
19+
20+
/**
21+
* Path to configuration.
22+
*
23+
* @since 1.14.4-1.3.0
24+
*/
25+
val path: String
26+
27+
/**
28+
* Load configuration from local storage or memory.
29+
* Also initializing configuration field.
30+
*
31+
* @since 1.14.4-1.3.0
32+
*/
33+
fun load()
34+
35+
/**
36+
* Save configuration to local storage.
37+
*
38+
* @since 1.14.4-1.3.0
39+
*/
40+
fun save()
41+
42+
/**
43+
* @return configuration model instance.
44+
*
45+
* @since 1.14.4-1.3.0
46+
*/
47+
fun take(): T
48+
}

0 commit comments

Comments
 (0)