cn.wjybxx.dson.codec.dsonlite.DsonLiteConverterUtils Maven / Gradle / Ivy
/*
* Copyright 2023-2024 wjybxx([email protected])
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.wjybxx.dson.codec.dsonlite;
import cn.wjybxx.dson.codec.ConverterUtils;
import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Map;
/**
* @author wjybxx
* date 2023/4/1
*/
public class DsonLiteConverterUtils extends ConverterUtils {
/** 默认codec注册表 */
private static final DsonLiteCodecRegistry CODEC_REGISTRY;
static {
Map, DsonLiteCodecImpl>> codecMap = DsonLiteCodecRegistries.newCodecMap(BUILTIN_CODECS.stream()
.map(DsonLiteCodecImpl::new)
.toList());
CODEC_REGISTRY = new DefaultCodecRegistry(codecMap);
}
public static DsonLiteCodecRegistry getDefaultCodecRegistry() {
return CODEC_REGISTRY;
}
@SuppressWarnings({"rawtypes", "unchecked"})
private static class DefaultCodecRegistry implements DsonLiteCodecRegistry {
final Map, DsonLiteCodecImpl>> codecMap;
final DsonLiteCodecImpl
© 2015 - 2024 Weber Informatics LLC | Privacy Policy