applies static method Null safety

bool applies(
  1. CooldownType instance,
  2. CooldownType check
)

Return whether check applies to instance.

A type is considered to apply to another if all the values making up that type are also present in the other type.

For example, CooldownType.user applies to CooldownType.user | CooldownType.guild while CooldownType.channel does not.

Implementation

static bool applies(CooldownType instance, CooldownType check) =>
    instance.value & check.value == check.value;