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
package com.qianwen.core.tool.metadata;
 
import com.qianwen.core.tool.utils.BeanUtil;
 
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/metadata/SimpleValue.class */
public class SimpleValue implements Value {
    private Object nativeValue;
 
    private SimpleValue(final Object nativeValue) {
        this.nativeValue = nativeValue;
    }
 
    public static SimpleValue of(final Object nativeValue) {
        return new SimpleValue(nativeValue);
    }
 
    @Override // org.springblade.core.tool.metadata.Value
    public Object get() {
        return this.nativeValue;
    }
 
    @Override // org.springblade.core.tool.metadata.Value
    public <T> T as(Class<T> type) {
        if (this.nativeValue == null) {
            return null;
        }
        if (type.isInstance(this.nativeValue)) {
            return (T) this.nativeValue;
        }
        return (T) BeanUtil.copyWithConvert(this.nativeValue, type);
    }
}