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 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

        org.apache.tinkerpop.shaded.kryo.Serializer<T> 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<org.apache.tinkerpop.shaded.kryo.Kryo,​org.apache.tinkerpop.shaded.kryo.Serializer> getFunctionOfShadedKryo()
        Returns:
        a function that accepts a shaded-Kryo instance and returns a serializer, if such a function is defined
      • registerWith

        org.apache.tinkerpop.shaded.kryo.Kryo registerWith​(org.apache.tinkerpop.shaded.kryo.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