- java.lang.Object
-
- de.skuzzle.test.snapshots.SnapshotFile
-
@API(status=EXPERIMENTAL) public final class SnapshotFile extends Object
A snapshot file is a plain text file containing a header and the actual serialized snapshot. The header is a simple key-value format which is separated from the actual snapshot contents by two line breaks (\n).- Since:
- 0.0.5
- Author:
- Simon Taddiken
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSnapshotFile.SnapshotHeader
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)static SnapshotFilefromSnapshotFile(Path file)inthashCode()SnapshotFile.SnapshotHeaderheader()Header information to this snapshot that are written by the framework.static SnapshotFileof(SnapshotFile.SnapshotHeader header, String snapshot)static SnapshotFilereadFrom(BufferedReader reader)Stringsnapshot()The serialized snapshot.SnapshotFilewriteTo(Path snapshotFile)
-
-
-
Method Detail
-
of
public static SnapshotFile of(SnapshotFile.SnapshotHeader header, String snapshot)
-
fromSnapshotFile
public static SnapshotFile fromSnapshotFile(Path file) throws IOException
- Throws:
IOException
-
readFrom
public static SnapshotFile readFrom(BufferedReader reader) throws IOException
- Throws:
IOException
-
header
public SnapshotFile.SnapshotHeader header()
Header information to this snapshot that are written by the framework.- Returns:
- The header.
-
snapshot
public String snapshot()
The serialized snapshot. This is the string that has been produced by theSnapshotSerializerin place.- Returns:
- The serialized snapshot string.
-
writeTo
public SnapshotFile writeTo(Path snapshotFile) throws IOException
- Throws:
IOException
-
-