All Downloads are FREE. Search and download functionalities are using the official Maven repository.

group.rxcloud.capa.addons.serialzer.value.converter.MapValueConverter Maven / Gradle / Ivy

package group.rxcloud.capa.addons.serialzer.value.converter;

import java.util.HashMap;
import java.util.Map;

public class MapValueConverter implements ValueConverter, Map> {

    private ValueConverter _valueConverter;

    public MapValueConverter(ValueConverter valueConverter) {
        _valueConverter = valueConverter;
    }

    @Override
    public Map convert(Map source) {
        if (source == null)
            return null;

        Map result = new HashMap<>();
        for (Map.Entry item : source.entrySet()) {
            result.put(item.getKey(), _valueConverter.convert(item.getValue()));
        }

        return result;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy