org.apache.tinkerpop.gremlin.structure.io.gryo

## Interface TypeRegistration<T>

- Type Parameters:
    `T` - the serializable type

      public interface TypeRegistration<T>

  Represents a class serializable with Gryo.

  At most one of the `getShadedSerializer()`, `getSerializerShim()`, and `getFunctionOfShadedKryo()` will return a non-null value. If all three methods return null, then there is no custom serialization logic associated with this class. Gryo/Kryo will use its default serializer.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `Function<Kryo,Serializer>` | `getFunctionOfShadedKryo()`
    `int` | `getId()`
    `SerializerShim<T>` | `getSerializerShim()`
    `<any>` | `getShadedSerializer()`
    `Class<T>` | `getTargetClass()`
    `default boolean` | `hasSerializer()` Returns true if at least one of `getShadedSerializer()`, `getSerializerShim()`, or `getFunctionOfShadedKryo()` is non null.
    `Kryo` | `registerWith(Kryo kryo)` Registers this type on the supplied `Kryo` instance, using whatever custom serializer may be present, then returns the same Kryo instance supplied as the parameter.

- - ### Method Detail

    - #### getTargetClass

          Class<T> getTargetClass()

      Returns:
        the serializable class this instance describes

    - #### getId

          int getId()

      Returns:
        numeric identifier used as a shorthand for this type in Gryo's serialized form

    - #### getShadedSerializer

          <any> getShadedSerializer()

      Returns:
        the shaded-Kryo serializer that handles this type, if one is defined

    - #### getSerializerShim

          SerializerShim<T> getSerializerShim()

      Returns:
        the shim-Kryo serializer that handles this type, if one is defined

    - #### getFunctionOfShadedKryo

          Function<Kryo,Serializer> getFunctionOfShadedKryo()

      Returns:
        a function that accepts a shaded-Kryo instance and returns a serializer, if such a function is defined

    - #### registerWith

          Kryo registerWith(Kryo kryo)

      Registers this type on the supplied `Kryo` instance, using whatever custom serializer may be present, then returns the same Kryo instance supplied as the parameter.
      Parameters:
        `kryo` - Kryo instance into which this type is registered
      Returns:
        the sole parameter

    - #### hasSerializer

          default boolean hasSerializer()

      Returns true if at least one of `getShadedSerializer()`, `getSerializerShim()`, or `getFunctionOfShadedKryo()` is non null. Returns false if all are null.
      Returns:
        whether a serializer is defined for this type registration

Copyright © 2013–2018 Apache Software Foundation. All rights reserved.