package com.qianwen.core.tool.metadata.config;
|
|
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/metadata/config/ConfigKey.class */
|
public interface ConfigKey<V> {
|
String getKey();
|
|
default String getName() {
|
return getKey();
|
}
|
|
default Class<V> getType() {
|
//return Object.class;
|
return (Class<V>)Object.class;
|
}
|
|
static <T> ConfigKey<T> of(String key) {
|
return of(key, key);
|
}
|
|
static <T> ConfigKey<T> of(String key, String name) {
|
//return SimpleConfigKey.of(key, name, Object.class);
|
return SimpleConfigKey.of(key, name, (Class)Object.class);
|
}
|
|
static <T> ConfigKey<T> of(String key, String name, Class<T> type) {
|
return SimpleConfigKey.of(key, name, (Class) type);
|
}
|
|
default ConfigKeyValue<V> value(final V value) {
|
return new ConfigKeyValue<V>() { // from class: org.springblade.core.tool.metadata.config.ConfigKey.1
|
@Override // org.springblade.core.tool.metadata.config.ConfigKeyValue
|
public V getValue() {
|
return (V) value;
|
}
|
|
@Override // org.springblade.core.tool.metadata.config.ConfigKey
|
public String getKey() {
|
return ConfigKey.this.getKey();
|
}
|
|
@Override // org.springblade.core.tool.metadata.config.ConfigKey
|
public String getName() {
|
return ConfigKey.this.getName();
|
}
|
|
@Override // org.springblade.core.tool.metadata.config.ConfigKey
|
public Class<V> getType() {
|
return ConfigKey.this.getType();
|
}
|
};
|
}
|
}
|