Interface ClassResolver

All Known Implementing Classes:
DefaultClassResolver

public interface ClassResolver
Handles class registration, writing class identifiers to bytes, and reading class identifiers from bytes.
  • Method Details

    • setKryo

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

      Registration register(Registration registration)
      Stores the specified registration.
      See Also:
    • registerImplicit

      Registration registerImplicit(Class type)
      Called when an unregistered type is encountered and Kryo.setRegistrationRequired(boolean) is false.
    • 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.
    • reset

      void reset()
      Called by Kryo.reset().