Class HandBallAppFileHandling
java.lang.Object
edu.ntnu.idatt1002.g106.handballapp.finalprod.fileHandling.HandBallAppFileHandling
This class provides method to serialize and deserialize a TournamentRegister
- Author:
- Group 6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TournamentRegisterDeserialize a tournamentRegister from theparam filestatic booleanserializeTournamentRegister(TournamentRegister tournamentRegister, File file) Method serializes anparam armyto theparam file
-
Constructor Details
-
HandBallAppFileHandling
public HandBallAppFileHandling()
-
-
Method Details
-
serializeTournamentRegister
public static boolean serializeTournamentRegister(TournamentRegister tournamentRegister, File file) throws IOException Method serializes anparam armyto theparam file- Parameters:
tournamentRegister- The tournamentRegister to serializefile- The file to serialize to- Returns:
trueif the serialization succeed orfalseif theparam tournamentRegisteris 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 theparam 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 reasonClassNotFoundException- if the class of the serialized object cannot be found
-