Files
workavia-mail-front/lib/features/caching/utils/cache_utils.dart
T
dab246 1b7ce6b37a Store mailbox cache by AccountId
(cherry picked from commit 7804f19d27d65af855e145de1953df9a553f3ce0)
2023-05-08 13:03:51 +07:00

29 lines
537 B
Dart

class TupleKey {
final List<String> parts;
TupleKey(
String key1,
[
String? key2,
String? key3
]
) : parts = [
key1,
if (key2 != null) key2,
if (key3 != null) key3,
];
const TupleKey.byParts(this.parts);
TupleKey.fromString(String multiKeyString) : parts = multiKeyString.split('|').toList();
@override
String toString() => parts.join('|');
@override
bool operator ==(other) => parts.toString() == other.toString();
@override
int get hashCode => Object.hashAll(parts);
}