2021-03-24 16:39:10 +07:00
|
|
|
/// Configuration Provider
|
|
|
|
///
|
|
|
|
/// @author sombochea
|
|
|
|
/// @since 1.0.0
|
2021-03-24 13:24:40 +07:00
|
|
|
abstract class ConfigurationProvider {
|
2021-03-24 16:39:10 +07:00
|
|
|
/// check has key or not in implemented classes
|
2021-03-24 13:24:40 +07:00
|
|
|
bool containsKey(String key);
|
2021-03-24 16:39:10 +07:00
|
|
|
|
|
|
|
/// get or null in implemented classes
|
2021-03-24 13:24:40 +07:00
|
|
|
String? getOrNull(String key, {String? defaultValue});
|
2021-05-14 15:52:57 +07:00
|
|
|
|
|
|
|
/// check has key or not for async function
|
|
|
|
Future<bool> containsKeyAsync(String key) async {
|
|
|
|
return Future.value(containsKey(key));
|
|
|
|
}
|
|
|
|
|
|
|
|
/// get or null for async function
|
|
|
|
Future<String?> getOrNullAsync(String key, {String? defaultValue}) async {
|
|
|
|
return Future.value(getOrNull(key, defaultValue: defaultValue));
|
|
|
|
}
|
2021-03-24 13:34:03 +07:00
|
|
|
}
|