getPersistenceKey method

FilePersistorKey? getPersistenceKey()

Implementation

FilePersistorKey? getPersistenceKey() {
  final documentSettings = persistorSettings;
  if (documentSettings is FilePersistorSettings<T>) {
    final keyBuilder = documentSettings.key;

    if (keyBuilder is FilePersistorDocumentKeyBuilder<T>) {
      return (keyBuilder as FilePersistorDocumentKeyBuilder).build(get()!);
    }

    if (keyBuilder is FilePersistorCollectionKeyBuilder<T>) {
      return keyBuilder.build();
    }
  }

  return null;
}