com.alibaba.csp.ahas.sentinel.datasource.parser.cluster.ClusterClientCommonConfigParser Maven / Gradle / Ivy
package com.alibaba.csp.ahas.sentinel.datasource.parser.cluster;
import com.alibaba.csp.sentinel.cluster.client.config.ClusterClientConfig;
import com.alibaba.csp.sentinel.datasource.Converter;
import com.alibaba.csp.sentinel.datasource.acm.DataAcmFormat;
import com.alibaba.csp.sentinel.log.RecordLog;
import com.alibaba.fastjson.JSON;
/**
* @author Eric Zhao
*/
public class ClusterClientCommonConfigParser implements Converter {
@Override
public ClusterClientConfig convert(String source) {
if (source == null) {
return null;
}
String data = new DataAcmFormat(source).getData();
if (data == null) {
return null;
}
return JSON.parseObject(data, ClusterClientConfig.class);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy