Interface YggdrasilSerializable.YggdrasilRobustEnum

Enclosing interface:
YggdrasilSerializable

public static interface YggdrasilSerializable.YggdrasilRobustEnum
Provides a method to resolve missing enum constants.
  • Method Summary

    Modifier and Type
    Method
    Description
    Enum<?>
    Called when an enum constant is read from stream that does not exist in this enum.
  • Method Details

    • excessiveConstant

      Enum<?> excessiveConstant(String name)
      Called when an enum constant is read from stream that does not exist in this enum.

      This method will be called on an arbitrary enum constant. An exception will be thrown if this enum is empty (because this method won't be able to return anything anyway).

      Parameters:
      name - The name read from stream
      Returns:
      The renamed enum constant or null if the read string is invalid. If the returned Enum is not an instance of this enum type an exception will be thrown.