permute method

  1. @override
T permute(
  1. T instance
)
override

Generates another instance with some deterministic function.

The only exception is Kind.forNull (because it has no other instances).

Implementation

@override
T permute(T instance) {
  final values = this.values;
  if (values.length < 2) {
    return instance;
  }
  return values[(instance.index + 1) % values.length];
}