ReThrowCorruptionHandler


public final class ReThrowCorruptionHandler<T extends Object> implements CorruptionHandler


Default corruption handler which does nothing but rethrow the exception.

Summary

Public constructors

Public methods

@NonNull T

This function will be called by DataStore when it encounters corruption.

Public constructors

ReThrowCorruptionHandler

public <T extends Object> ReThrowCorruptionHandler()

ReThrowCorruptionHandler

public <T extends Object> ReThrowCorruptionHandler()

Public methods

handleCorruption

public @NonNullhandleCorruption(@NonNull CorruptionException ex)

This function will be called by DataStore when it encounters corruption. If the implementation of this function throws an exception, it will be propagated to the original call to DataStore. Otherwise, the returned data will be written to disk.

This function should not interact with any DataStore API - doing so can result in a deadlock.

Parameters
@NonNull CorruptionException ex

is the exception encountered when attempting to deserialize data from disk.

Returns
@NonNull T

The value that DataStore should attempt to write to disk.