yangys
2024-04-04 2cf2921440e7473ae50796c2cb688f609b3a7995
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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;
 
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/metadata/types/AbstractType.class */
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;
    }
}