package com.qianwen.core.tool.metadata.types;
|
|
import java.util.HashMap;
|
import java.util.Map;
|
import com.qianwen.core.tool.metadata.DataType;
|
import com.qianwen.core.tool.metadata.config.ConfigKey;
|
import com.qianwen.core.tool.metadata.config.ConfigKeyValue;
|
import org.springframework.util.CollectionUtils;
|
|
|
public abstract class AbstractType<R> implements DataType {
|
private Map<String, Object> expands;
|
private String description;
|
|
@Override // org.springblade.core.tool.metadata.Metadata
|
public void setExpands(final Map<String, Object> expands) {
|
this.expands = expands;
|
}
|
|
@Override // org.springblade.core.tool.metadata.Metadata
|
public void setDescription(final String description) {
|
this.description = description;
|
}
|
|
@Override // org.springblade.core.tool.metadata.DataType, org.springblade.core.tool.metadata.Metadata
|
public Map<String, Object> getExpands() {
|
return this.expands;
|
}
|
|
@Override // org.springblade.core.tool.metadata.Metadata
|
public String getDescription() {
|
return this.description;
|
}
|
|
/* JADX WARN: Multi-variable type inference failed */
|
/*
|
public R expands(Map<String, Object> expands) {
|
if (CollectionUtils.isEmpty(expands)) {
|
return this;
|
}
|
if (this.expands == null) {
|
this.expands = new HashMap();
|
}
|
this.expands.putAll(expands);
|
return this;
|
}*/
|
public R expands(Map<String, Object> expands) {
|
if (CollectionUtils.isEmpty(expands))
|
return (R)this;
|
if (this.expands == null)
|
this.expands = new HashMap<>();
|
this.expands.putAll(expands);
|
return (R)this;
|
}
|
|
/* JADX WARN: Multi-variable type inference failed */
|
public R expand(ConfigKeyValue<?>... kvs) {
|
for (ConfigKeyValue<?> kv : kvs) {
|
expand(kv.getKey(), kv.getValue());
|
}
|
return (R)this;
|
}
|
|
public <V> R expand(ConfigKey<V> configKey, V value) {
|
return expand(configKey.getKey(), value);
|
}
|
|
/* JADX WARN: Multi-variable type inference failed */
|
public R expand(String configKey, Object value) {
|
if (value == null) {
|
return (R)this;
|
}
|
if (this.expands == null) {
|
this.expands = new HashMap<>();
|
}
|
this.expands.put(configKey, value);
|
return (R)this;
|
}
|
|
/* JADX WARN: Multi-variable type inference failed */
|
public R description(String description) {
|
this.description = description;
|
return (R)this;
|
}
|
}
|