Interface ClassResolver

  • All Known Implementing Classes:
    DefaultClassResolver

    public interface ClassResolver
    Handles class registration, writing class identifiers to bytes, and reading class identifiers from bytes.
    Author:
    Nathan Sweet
    • Method Detail

      • setKryo

        void setKryo​(Kryo kryo)
        Sets the Kryo instance that this ClassResolver will be used for. This is called automatically by Kryo.
      • unregister

        Registration unregister​(int classID)
        Removes the registration for the specified ID.
        Returns:
        May be null if the class ID was not registered.
      • getRegistration

        Registration getRegistration​(Class type)
        Returns the registration for the specified class, or null if the class is not registered.
      • getRegistration

        Registration getRegistration​(int classID)
        Returns the registration for the specified ID, or null if no class is registered with that ID.
      • writeClass

        Registration writeClass​(Output output,
                                Class type)
        Writes a class and returns its registration.
        Parameters:
        type - May be null.
        Returns:
        Will be null if type is null.
      • readClass

        Registration readClass​(Input input)
        Reads a class and returns its registration.
        Returns:
        May be null.