Interface ClassResolver

All Known Implementing Classes:
ConfigurationSerializer, EnumSerializer, JRESerializer, Serializer, SimpleClassResolver, YggdrasilSerializer, YggdrasilSerializer

public interface ClassResolver
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable Class<?>
    Resolves a class by its ID.
    @Nullable String
    getID​(Class<?> c)
    Gets an ID for a Class.
  • Method Details

    • getClass

      @Nullable Class<?> getClass(String id)
      Resolves a class by its ID.
      Parameters:
      id - The ID used when storing objects
      Returns:
      The Class object that represents data with the given ID, or null if the ID does not belong to the implementor
    • getID

      @Nullable String getID(Class<?> c)
      Gets an ID for a Class. The ID is used to identify the type of a saved object.

      // TODO make sure that it's unique

      Parameters:
      c - The class to get the ID of
      Returns:
      The ID of the given class, or null if this is not a class of the implementor