yangys
2024-03-28 25475f31cd0d52ff328bbea9e80f15647dedd80b
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
package com.qianwen.core.tool.convert;
 
import org.springframework.boot.convert.ApplicationConversionService;
import org.springframework.core.convert.support.GenericConversionService;
import org.springframework.lang.Nullable;
import org.springframework.util.StringValueResolver;
 
/* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/convert/BladeConversionService.class */
public class BladeConversionService extends ApplicationConversionService {
    @Nullable
    private static volatile BladeConversionService SHARED_INSTANCE;
 
    public BladeConversionService() {
        this(null);
    }
 
    public BladeConversionService(@Nullable StringValueResolver embeddedValueResolver) {
        super(embeddedValueResolver);
        super.addConverter(new EnumToStringConverter());
        super.addConverter(new StringToEnumConverter());
    }
 
    public static GenericConversionService getInstance() {
        BladeConversionService sharedInstance = SHARED_INSTANCE;
        if (sharedInstance == null) {
            synchronized (BladeConversionService.class) {
                sharedInstance = SHARED_INSTANCE;
                if (sharedInstance == null) {
                    sharedInstance = new BladeConversionService();
                    SHARED_INSTANCE = sharedInstance;
                }
            }
        }
        return sharedInstance;
    }
}