Interface MigrateSource.Filter<C_OLD>

Type Parameters:
C_OLD - the old configuration type
Enclosing interface:
MigrateSource<C>

public static interface MigrateSource.Filter<C_OLD>
A filter for old configuration versions.

Instances of this type can be applied by using MigrateSource.addFilter(Filter).

Normally, a MigrateSource is responsible for detecting the validity of an old version. Still, this type exists to make the API more usable, so that callers don't have to re-implement MigrateSource themselves.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isUsable(@NonNull C_OLD oldConfig)
    Checks whether the given old configuration should be used.
  • Method Details

    • isUsable

      boolean isUsable(@NonNull C_OLD oldConfig)
      Checks whether the given old configuration should be used.

      This method is called after the original MigrateSource.load(MigrateContext) to filter the value coming from it. If it returns false, the Transition will not be invoked.

      Parameters:
      oldConfig - the old configuration
      Returns:
      true if usable