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

com.spotify.docker.client.shaded.com.fasterxml.jackson.datatype.guava.deser.ImmutableSortedMapDeserializer Maven / Gradle / Ivy

There is a newer version: 8.16.0
Show newest version
package com.fasterxml.jackson.datatype.guava.deser;

import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.KeyDeserializer;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.fasterxml.jackson.databind.type.MapType;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.ImmutableSortedMap;

public class ImmutableSortedMapDeserializer extends GuavaImmutableMapDeserializer> {

    public ImmutableSortedMapDeserializer(MapType type, KeyDeserializer keyDeser, TypeDeserializer typeDeser,
            JsonDeserializer deser) {
        super(type, keyDeser, typeDeser, deser);
    }

    @SuppressWarnings("unchecked")
    @Override
    protected Builder createBuilder() {
        /*
         * Not quite sure what to do with sorting/ordering; may require better
         * support either via annotations, or via custom serialization (bean
         * style that includes ordering aspects)
         */
        @SuppressWarnings("rawtypes")
        ImmutableSortedMap.Builder naturalOrder = ImmutableSortedMap.naturalOrder();
        ImmutableSortedMap.Builder builder = (ImmutableSortedMap.Builder) naturalOrder;
        return builder;
    }

    @Override
    public GuavaMapDeserializer> withResolved(KeyDeserializer keyDeser,
            TypeDeserializer typeDeser, JsonDeserializer valueDeser) {
        return new ImmutableSortedMapDeserializer(_mapType, keyDeser, typeDeser, valueDeser);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy