com.fasterxml.jackson.databind

## Class ObjectWriter.Prefetch

- java.lang.Object
- - com.fasterxml.jackson.databind.ObjectWriter.Prefetch

All Implemented Interfaces:
  Serializable

Enclosing class:
  ObjectWriter

    public static final class ObjectWriter.Prefetch
    extends Object
    implements Serializable

As a minor optimization, we will make an effort to pre-fetch a serializer, or at least relevant `TypeSerializer`, if given enough information.

Since:
  2.5
See Also:
  Serialized Form

### Field Summary

Fields
`static ObjectWriter.Prefetch` `empty`
`JavaType` `rootType` Specified root serialization type to use; can be same as runtime type, but usually one of its super types
`TypeSerializer` `typeSerializer` When dealing with polymorphic types, we can not pre-fetch serializer, but we can pre-fetch `TypeSerializer`.
`JsonSerializer<Object>` `valueSerializer` We may pre-fetch serializer if `rootType` is known, and if so, reuse it afterwards.

### Method Summary

Methods
`static ObjectWriter.Prefetch` `construct(JavaType type, JsonSerializer<Object> ser)`
`static ObjectWriter.Prefetch` `construct(JavaType type, TypeSerializer typeSer)`
`boolean` `hasSerializer()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### empty

    public static final ObjectWriter.Prefetch empty

#### rootType

    public final JavaType rootType

Specified root serialization type to use; can be same as runtime type, but usually one of its super types

#### valueSerializer

    public final JsonSerializer<Object> valueSerializer

We may pre-fetch serializer if `rootType` is known, and if so, reuse it afterwards. This allows avoiding further serializer lookups and increases performance a bit on cases where readers are reused.

#### typeSerializer

    public final TypeSerializer typeSerializer

When dealing with polymorphic types, we can not pre-fetch serializer, but we can pre-fetch `TypeSerializer`.

### Method Detail

#### construct

    public static ObjectWriter.Prefetch construct(JavaType type,
                                  JsonSerializer<Object> ser)

#### construct

    public static ObjectWriter.Prefetch construct(JavaType type,
                                  TypeSerializer typeSer)

#### hasSerializer

    public boolean hasSerializer()