com.conveyal.gtfs.error.ReferentialIntegrityError Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gtfs-lib Show documentation
Show all versions of gtfs-lib Show documentation
A library to load and index GTFS feeds of arbitrary size using disk-backed storage
package com.conveyal.gtfs.error;
import java.io.Serializable;
/** Indicates that an entity referenced another entity that does not exist. */
public class ReferentialIntegrityError extends GTFSError implements Serializable {
public static final long serialVersionUID = 1L;
// TODO: maybe also store the entity ID of the entity which contained the bad reference, in addition to the row number
public final String badReference;
public ReferentialIntegrityError(String tableName, long row, String field, String badReference) {
super(tableName, row, field);
this.badReference = badReference;
}
/** must be comparable to put into mapdb */
@Override
public int compareTo (GTFSError o) {
int compare = super.compareTo(o);
if (compare != 0) return compare;
return this.badReference.compareTo((((ReferentialIntegrityError) o).badReference));
}
@Override public String getMessage() {
return String.format(badReference);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy