validate method

  1. @override
bool validate(
  1. MustMatchCacheEntry cached,
  2. dynamic instance,
  3. DogEngine engine
)
override

Validates instance against this validator, where instance is not the field value but the whole class instance.

Implementation

@override
bool validate(MustMatchCacheEntry cached, instance, DogEngine engine) {
  final selfValue = cached.proxy.getField(instance, cached.selfIndex);
  final otherValue = cached.proxy.getField(instance, cached.otherIndex);
  return deepEquality.equals(selfValue, otherValue);
}