Interface YggdrasilSerializable.YggdrasilRobustSerializable

All Superinterfaces:
YggdrasilSerializable
All Known Implementing Classes:
Direction
Enclosing interface:
YggdrasilSerializable

public static interface YggdrasilSerializable.YggdrasilRobustSerializable extends YggdrasilSerializable
A class that has had fields added, changed, or removed from it should implement this interface to handle the now invalid/missing fields that may still be read from stream.
  • Method Details

    • incompatibleField

      boolean incompatibleField(@NotNull @NotNull Field field, @NotNull @NotNull Fields.FieldContext value) throws StreamCorruptedException
      Called if a field that was read from stream is of an incompatible type to the existing field in this class.
      Parameters:
      field - The Java field
      value - The field read from stream
      Returns:
      Whether the field was handled. If false, yggdrasil.incompatibleField(this, field, value) will be called.
      Throws:
      StreamCorruptedException
    • excessiveField

      boolean excessiveField(@NotNull @NotNull Fields.FieldContext field) throws StreamCorruptedException
      Called if a field was read from stream which does not exist in this class.
      Parameters:
      field - The field read from stream
      Returns:
      Whether the field was handled. If false, yggdrasil.excessiveField(this, field) will be called.
      Throws:
      StreamCorruptedException
    • missingField

      boolean missingField(@NotNull @NotNull Field field) throws StreamCorruptedException
      Called if a field was not found in the stream.
      Parameters:
      field - The field that did not occur in the stream
      Returns:
      Whether the field was handled (e.g. true if the default value is fine). If false, yggdrasil.missingField(this, field) will be called.
      Throws:
      StreamCorruptedException