Make tests pass again. Gson demands no-args constructors.

This commit is contained in:
iwakeh 2016-12-26 13:11:34 +01:00 committed by Karsten Loesing
parent 9a61983055
commit fa2d227527
3 changed files with 22 additions and 0 deletions

View File

@ -26,6 +26,13 @@ public class DirectoryNode implements Comparable<DirectoryNode> {
@Expose
public final SortedSet<DirectoryNode> directories;
/* Added to satisfy Gson. */
private DirectoryNode() {
path = null;
files = null;
directories = null;
}
/** A directory for the JSON structure. */
public DirectoryNode(String path, SortedSet<FileNode> files,
SortedSet<DirectoryNode> directories) {

View File

@ -39,6 +39,13 @@ public class FileNode implements Comparable<FileNode> {
private long lastModifiedMillis;
/* Added to satisfy Gson. */
private FileNode() {
path = null;
size = 0;
lastModified = null;
}
/**
* A FileNode needs a path, i.e. the file name, the file size, and
* the last modified date-time string.

View File

@ -56,6 +56,14 @@ public class IndexNode {
@Expose
public final SortedSet<FileNode> files;
/* Added to satisfy Gson. */
private IndexNode() {
created = null;
path = null;
files = null;
directories = null;
}
/** An index node is the top-level node in the JSON structure. */
public IndexNode(String created, String path,
SortedSet<FileNode> files,