validateSnapshot method

  1. @override
void validateSnapshot(
  1. Object image
)
override

Rejects an image that cannot be restored by this policy.

Implementation

@override
void validateSnapshot(Object image) {
  if (image is! List<int> ||
      image.length != _next.length ||
      image.any((way) => way < 0 || way >= _ways)) {
    throw ArgumentError('Invalid round-robin replacement image.');
  }
}