Interface IUniverseResourceStorage

All Known Implementing Classes:
DiskUniverseResourceStorageProvider.DiskUniverseResourceStorage

public interface IUniverseResourceStorage
The backing store for universe resources. Implementations own where the data lives and how it is read and written.
  • Method Details

    • loadAll

      @Nonnull Map<UniverseResourceType<?>, Object> loadAll(@Nonnull Collection<? extends UniverseResourceType<?>> types)
      Loads every given resource type. A type without stored data maps to the codec's default value.
      Parameters:
      types - The resource types to load.
      Returns:
      one shared instance per given type.
    • save

      @Nonnull <T> CompletableFuture<Void> save(@Nonnull UniverseResourceType<T> type, @Nonnull T resource)
      Writes one resource.
      Type Parameters:
      T - The resource type.
      Parameters:
      type - The resource type to write.
      resource - The resource instance to write.
      Returns:
      a future that completes when the write is durable.