Package javatro.storage


package javatro.storage
Provides classes and utilities for managing game data persistence, retrieval, validation, and parsing.

This package includes the following components:

  • Storage - The primary interface for interacting with the storage system, following the Singleton pattern.
  • StorageManager - Handles low-level storage operations, including saving, loading, and initializing game data.
  • DataParser - Provides static utility methods for parsing and validating CSV data, ensuring data integrity before loading.
  • javatro.storage.utils - A sub-package containing utility classes such as:
    • CardUtils - Utility functions for card and joker parsing, validation, and formatting.
    • HashUtil - Provides a hashing mechanism using SHA-256 for verifying data integrity.

This package is designed to work with the broader application through a clear interface provided by Storage. Underlying operations are delegated to the StorageManager, ensuring separation of concerns and better modularity.

Assertions are employed throughout the package to ensure data consistency and validity.

  • Classes
    Class
    Description
    The DataParser class provides static utility methods for parsing, validating, and loading CSV data related to game runs.
    The Storage class serves as a facade to interact with the underlying storage mechanism managed by StorageManager.
    The StorageManager class is responsible for managing the storage of game data, including reading from and writing to a save file.