Class HandBallAppFileHandling

java.lang.Object
edu.ntnu.idatt1002.g106.handballapp.finalprod.fileHandling.HandBallAppFileHandling

public class HandBallAppFileHandling extends Object
This class provides method to serialize and deserialize a TournamentRegister
Author:
Group 6
  • Constructor Details

    • HandBallAppFileHandling

      public HandBallAppFileHandling()
  • Method Details

    • serializeTournamentRegister

      public static boolean serializeTournamentRegister(TournamentRegister tournamentRegister, File file) throws IOException
      Method serializes an param army to the param file
      Parameters:
      tournamentRegister - The tournamentRegister to serialize
      file - The file to serialize to
      Returns:
      true if the serialization succeed or false if the param tournamentRegister is null
      Throws:
      IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
    • deserializeTournamentRegister

      public static TournamentRegister deserializeTournamentRegister(File file) throws IOException, ClassNotFoundException
      Deserialize a tournamentRegister from the param file
      Parameters:
      file - The file to deserialize from
      Returns:
      The deserialized tournamentRegister if there is registered a tournamentRegister, otherwise null
      Throws:
      IOException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason
      ClassNotFoundException - if the class of the serialized object cannot be found