Skip to content

Commit

Permalink
add serialization fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
landonreed committed Feb 8, 2018
1 parent 24392ed commit 2f4da7e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/main/java/com/conveyal/gtfs/loader/FeedLoadResult.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package com.conveyal.gtfs.loader;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;

/**
* An instance of this class is returned by the GTFS feed loading method.
* It provides a summary of what happened during the loading process.
* It also provides the unique name that was assigned to this feed by the loader.
* That unique name is the name of a database schema including all the tables loaded from this feed.
*
* Ignore unknown properties on deserialization to avoid conflicts with past versions. FIXME
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class FeedLoadResult implements Serializable {

private static final long serialVersionUID = 1L;
Expand All @@ -31,4 +36,27 @@ public class FeedLoadResult implements Serializable {

public long loadTimeMillis;
public long completionTime;

public FeedLoadResult () {
this(false);
}

/**
* Optional constructor to generate blank table load results on instantiation.
*/
public FeedLoadResult (boolean constructTableResults) {
agency = new TableLoadResult();
calendar = new TableLoadResult();
calendarDates = new TableLoadResult();
fareAttributes = new TableLoadResult();
fareRules = new TableLoadResult();
feedInfo = new TableLoadResult();
frequencies = new TableLoadResult();
routes = new TableLoadResult();
shapes = new TableLoadResult();
stops = new TableLoadResult();
stopTimes = new TableLoadResult();
transfers = new TableLoadResult();
trips = new TableLoadResult();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
import com.conveyal.gtfs.model.Pattern;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.time.LocalDate;
import java.util.List;

Expand All @@ -11,7 +14,10 @@
* It groups together several kinds of information about what happened during the validation process.
* Detailed lists of errors can be found in database tables created by the validator, but this class provides
* immediate summary information.
*
* Ignore unknown properties on deserialization to avoid conflicts with past versions. FIXME
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class ValidationResult implements Serializable {

private static final long serialVersionUID = 1L;
Expand Down

0 comments on commit 2f4da7e

Please sign in to comment.