@param deserializer {@link JsonDeserializer} used to deserialize the objects inside the {@link LinkedHashMultiset}.
@param <T> Type of the elements inside the {@link LinkedHashMultiset}

@return a new instance of {@link LinkedHashMultisetJsonDeserializer}
545153
public static <T> LinkedHashMultisetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new LinkedHashMultisetJsonDeserializer<T>( deserializer );
    }
364389
@SuppressWarnings("unchecked")
    private static Deserializer<?> getDeserializer(Configuration conf) {
        String deserializerClassName = conf.get(HBaseBackfillMerger.CONFKEY_DESERIALIZER);
        if (deserializerClassName == null) {
            throw new RuntimeException("Configuration didn't set " + deserializerClassName);
        }
        try {
            Class<?> deserializerClass = Class.forName(deserializerClassName);

            if (!Deserializer.class.isAssignableFrom(deserializerClass)) {
                final String errMsg = "The provided deserializer class " +
                        conf.get(HBaseBackfillMerger.CONFKEY_DESERIALIZER) + "doesn't implement " +
                        Deserializer.class.getName();
                log.error(errMsg);
            }

            return ((Class<? extends Deserializer<?>>) deserializerClass).newInstance();
        } catch (Exception e) {
            log.error("Couldn't instantiate deserializer", e);
            throw new RuntimeException(e);
        }
    }
1111257
public <T> Descriptor withMessageSerializer(Class<T> messageType, MessageSerializer<T, ?> messageSerializer) {
        return withMessageSerializer((Type) messageType, messageSerializer);
    }
386705
def json_decoder_to_deserializer(decoder_cls: Union[Type[JSONDecoder], Callable[[], Type[JSONDecoder]]]) \
        -> Type[Deserializer]:
    
    name = decoder_cls.__name__ if isinstance(decoder_cls, type) else "%sLambdaTypeReturn" % id(decoder_cls)
    return type(
        "%sAsDeserializer" % name,
        (_JSONDecoderAsDeserializer,),
        {
            "decoder_type": property(lambda self: decoder_cls if isinstance(decoder_cls, type) else decoder_cls())
        }
    )
381750
public static <T> IterableJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new IterableJsonDeserializer<T>( deserializer );
    }
243679
public static <T> HashMultisetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new HashMultisetJsonDeserializer<T>( deserializer );
    }
95368
public static ResponseDeserializer getResponseDeserializer(String jsonStr) throws JsonParseException, JsonMappingException, IOException{
        final ResponsePair p = mapper.readValue(jsonStr, ResponsePair.class);
        Response rr = null;
        if(p.getType() != null){
            rr = (Response) mapper.readValue(p.getResponse(), p.getType());
        }
        final Response resp = rr;

        return new ResponseDeserializer(){

            @Override
            public ResponseHeader deserializerResponseHeader() {
                return p.getResponseHeader();
            }

            @Override
            public Response deserializerResponse() {
                return resp;
            }

        };

    }
954161
@Override
    public <T> T deserialize(String body, TypeRef returnType) throws JsonMarshallingException {
        try {
            return deserializeChecked(body, returnType);
        } catch (Exception e) {
            throw new JsonMarshallingException(e);
        }
    }
727391
public static <T> VectorJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new VectorJsonDeserializer<T>( deserializer );
    }
670914
protected JsonDeserializer<Object> _findRootDeserializer(DeserializationConfig cfg, JavaType valueType)
            throws JsonMappingException {

        // Sanity check: must have actual type...
        if (valueType == null) {
            throw new JsonMappingException("No value type configured for ObjectReader");
        }

        // First: have we already seen it?
        JsonDeserializer<Object> deser = _rootDeserializers.get(valueType);
        if (deser != null) {
            return deser;
        }

        // es-hadoop: findType with 2 args have been removed since 1.9 so this code compiles on 1.8 (which has the fallback method)
        // es-hadoop: on 1.5 only the 2 args method exists, since 1.9 only the one with 3 args hence the if

        // Nope: need to ask provider to resolve it
        deser = _provider.findTypedValueDeserializer(cfg, valueType);
        if (deser == null) { // can this happen?
            throw new JsonMappingException("Can not find a deserializer for type " + valueType);
        }
        _rootDeserializers.put(valueType, deser);
        return deser;
    }
529760
public static <T> QueueJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new QueueJsonDeserializer<T>( deserializer );
    }
1280065
public static <T> AbstractSetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new AbstractSetJsonDeserializer<T>( deserializer );
    }
996555
@SuppressWarnings("unchecked")
    public <T> T decode(Type type, JsonNode jsonNode) throws Exception {
        return (T) (mapper.fromJson(jsonNode, type));
    }
948669
public static <T> SetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new SetJsonDeserializer<T>( deserializer );
    }
910335
@SuppressWarnings("unchecked")
    public <T> T deserialize(String body, Type returnType) {
        try {
            if (isLenientOnJson) {
                JsonReader jsonReader = new JsonReader(new StringReader(body));
                // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean)
                jsonReader.setLenient(true);
                return gson.fromJson(jsonReader, returnType);
            } else {
                return gson.fromJson(body, returnType);
            }
        } catch (JsonParseException e) {
            // Fallback processing when failed to parse JSON form response body:
            // return the response body string directly for the String return type;
            if (returnType.equals(String.class))
                return (T) body;
            else
                throw (e);
        }
    }
857556
public static <T> T fromJson(JsonNode json, Class<T> clazz, ClassLoader classLoader) {
        if (json == null) {
            return null;
        }
        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        if (classLoader != null) {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        try {
            ObjectMapper mapper = poolMapper.borrowObject();
            if (mapper != null) {
                try {
                    return mapper.readValue(json.toString(), clazz);
                } finally {
                    poolMapper.returnObject(mapper);
                }
            }
            throw new DeserializationException("No ObjectMapper instance avaialble!");
        } catch (Exception e) {
            throw e instanceof DeserializationException ? (DeserializationException) e
                    : new DeserializationException(e);
        } finally {
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
    }
221592
public static <T> ImmutableSetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new ImmutableSetJsonDeserializer<T>( deserializer );
    }