@param keySerializer {@link KeySerializer} used to serialize the keys.
@param valueSerializer {@link JsonSerializer} used to serialize the values.
@param <M> Type of the {@link Multimap}

@return a new instance of {@link MultimapJsonSerializer}
494733
public static <M extends Multimap<?, ?>> MultimapJsonSerializer<M, ?, ?> newInstance( KeySerializer<?> keySerializer,
                                                                                          JsonSerializer<?> valueSerializer ) {
        return new MultimapJsonSerializer( keySerializer, valueSerializer );
    }
363590
private TypeSerializer<Object> createSerializer(Object key, int pos) {
		if (key == null) {
			throw new NullKeyFieldException(pos);
		}
		try {
			TypeInformation<Object> info = TypeExtractor.getForObject(key);
			return info.createSerializer(executionConfig);
		}
		catch (Throwable t) {
			throw new RuntimeException("Could not create key serializer for type " + key);
		}
	}
1212882
public CacheConfigurationBuilder<K, V> withKeySerializer(Serializer<K> keySerializer) {
    return withSerializer(new DefaultSerializerConfiguration<>(requireNonNull(keySerializer, "Null key serializer"), DefaultSerializerConfiguration.Type.KEY));
  }
221592
public static <T> ImmutableSetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new ImmutableSetJsonDeserializer<T>( deserializer );
    }
997526
public static <T> MemcachedClientBuilder<T> newJsonClient(final ObjectMapper objectMapper, final Class<T> valueType) {
    return newClient(new JsonTranscoder<>(objectMapper, valueType));
  }
1043493
public static <T extends Comparable<T>> ImmutableSortedSetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new ImmutableSortedSetJsonDeserializer<T>( deserializer );
    }
1217024
public static <K extends Comparable, V extends Comparable> TreeMultimap<K, V> create(
      Multimap<? extends K, ? extends V> multimap) {
    return new TreeMultimap<K, V>(Ordering.natural(), Ordering.natural(), multimap);
  }
1036670
public UserManagedCacheBuilder<K, V, T> withValueSerializer(Serializer<V> valueSerializer) {
    if (valueSerializer == null) {
      throw new NullPointerException("Null value serializer");
    }
    UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
    otherBuilder.valueSerializer = valueSerializer;
    return otherBuilder;
  }
750905
public static <T> ImmutableListJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new ImmutableListJsonDeserializer<T>( deserializer );
    }
297605
public static <E extends Enum<E>> EnumMultisetJsonDeserializer<E> newInstance( EnumJsonDeserializer<E> deserializer ) {
        return new EnumMultisetJsonDeserializer<E>( deserializer );
    }
938263
public static <K, V> Marshaller<KeyValue<K, ? extends Iterable<V>>> getKeyValuesMarshaller(
      Marshaller<K> keyMarshaller, Marshaller<V> valueMarshaller) {
    return new KeyValuesMarshaller<>(keyMarshaller, valueMarshaller);
  }
922952
@Singleton
    @Primary
    @BootstrapContextCompatible
    public ObjectMapper objectMapper(@Nullable JacksonConfiguration jacksonConfiguration,
                                     @Nullable JsonFactory jsonFactory) {

        ObjectMapper objectMapper = jsonFactory != null ? new ObjectMapper(jsonFactory) : new ObjectMapper();

        final boolean hasConfiguration = jacksonConfiguration != null;
        if (!hasConfiguration || jacksonConfiguration.isModuleScan()) {
            objectMapper.findAndRegisterModules();
        }
        objectMapper.registerModules(jacksonModules);
        SimpleModule module = new SimpleModule(MICRONAUT_MODULE);
        for (JsonSerializer serializer : serializers) {
            Class<? extends JsonSerializer> type = serializer.getClass();
            Type annotation = type.getAnnotation(Type.class);
            if (annotation != null) {
                Class[] value = annotation.value();
                for (Class aClass : value) {
                    module.addSerializer(aClass, serializer);
                }
            } else {
                Optional<Class> targetType = GenericTypeUtils.resolveSuperGenericTypeArgument(type);
                if (targetType.isPresent()) {
                    module.addSerializer(targetType.get(), serializer);
                } else {
                    module.addSerializer(serializer);
                }
            }
        }

        for (JsonDeserializer deserializer : deserializers) {
            Class<? extends JsonDeserializer> type = deserializer.getClass();
            Type annotation = type.getAnnotation(Type.class);
            if (annotation != null) {
                Class[] value = annotation.value();
                for (Class aClass : value) {
                    module.addDeserializer(aClass, deserializer);
                }
            } else {
                Optional<Class> targetType = GenericTypeUtils.resolveSuperGenericTypeArgument(type);
                targetType.ifPresent(aClass -> module.addDeserializer(aClass, deserializer));
            }
        }
        objectMapper.registerModule(module);

        for (BeanSerializerModifier beanSerializerModifier : beanSerializerModifiers) {
            objectMapper.setSerializerFactory(
                objectMapper.getSerializerFactory().withSerializerModifier(
                    beanSerializerModifier
                ));
        }

        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
        objectMapper.configure(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS, true);

        if (hasConfiguration) {

            ObjectMapper.DefaultTyping defaultTyping = jacksonConfiguration.getDefaultTyping();
            if (defaultTyping != null) {
                objectMapper.enableDefaultTyping(defaultTyping);
            }

            JsonInclude.Include include = jacksonConfiguration.getSerializationInclusion();
            if (include != null) {
                objectMapper.setSerializationInclusion(include);
            }
            String dateFormat = jacksonConfiguration.getDateFormat();
            if (dateFormat != null) {
                objectMapper.setDateFormat(new SimpleDateFormat(dateFormat));
            }
            Locale locale = jacksonConfiguration.getLocale();
            if (locale != null) {
                objectMapper.setLocale(locale);
            }
            TimeZone timeZone = jacksonConfiguration.getTimeZone();
            if (timeZone != null) {
                objectMapper.setTimeZone(timeZone);
            }
            PropertyNamingStrategy propertyNamingStrategy = jacksonConfiguration.getPropertyNamingStrategy();
            if (propertyNamingStrategy != null) {
                objectMapper.setPropertyNamingStrategy(propertyNamingStrategy);
            }
            
            jacksonConfiguration.getSerializationSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getDeserializationSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getMapperSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getParserSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getGeneratorSettings().forEach(objectMapper::configure);
        }
        return objectMapper;
    }
1280065
public static <T> AbstractSetJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new AbstractSetJsonDeserializer<T>( deserializer );
    }
1165942
public Optional<MapperInstance> getSerializer( JType type ) {
        return Optional.fromNullable( serializers.get( type.getQualifiedSourceName() ) );
    }
176394
@Override
	public JacksonWrapperSerializer createSerializer(OutputStream out, JsonEncoding encoding) {
		try {
			JsonGenerator generator = innerFactory.createGenerator(out, encoding);
			// generator.setPrettyPrinter(new MinimalPrettyPrinter());
			return new JacksonWrapperSerializer(generator, getSupportedFormat());
		} catch (IOException e) {
			e.printStackTrace();
			throw new KriptonRuntimeException(e);
		}
	}
159402
static <T> PojoSerializerSnapshotData<T> createFrom(
			Class<T> pojoClass,
			Field[] fields,
			TypeSerializerSnapshot<?>[] existingFieldSerializerSnapshots,
			LinkedHashMap<Class<?>, TypeSerializerSnapshot<?>> existingRegisteredSubclassSerializerSnapshots,
			Map<Class<?>, TypeSerializerSnapshot<?>> existingNonRegisteredSubclassSerializerSnapshots) {

		final LinkedOptionalMap<Field, TypeSerializerSnapshot<?>> fieldSerializerSnapshots = new LinkedOptionalMap<>(fields.length);
		for (int i = 0; i < fields.length; i++) {
			Field field = fields[i];
			String fieldName = (field == null) ? getDummyNameForMissingField(i) : field.getName();
			fieldSerializerSnapshots.put(fieldName, field, existingFieldSerializerSnapshots[i]);
		}

		return new PojoSerializerSnapshotData<>(
			pojoClass,
			fieldSerializerSnapshots,
			optionalMapOf(existingRegisteredSubclassSerializerSnapshots, Class::getName),
			optionalMapOf(existingNonRegisteredSubclassSerializerSnapshots, Class::getName));
	}
275155
public static <T> Array2dJsonSerializer<T> newInstance( JsonSerializer<T> serializer ) {
        return new Array2dJsonSerializer<T>( serializer );
    }