public Route(GTFSPropertyCollection properties) : base(properties, "route_id") { if (!properties.ContainsKey("route_short_name") && !properties.ContainsKey("route_long_name")) { throw new InvalidDataException("Routes must have either a long name or a short name."); } if (!properties.IsInt("route_type")) { throw new InvalidDataException("Routes must have a type."); } }
public static double GetDouble(this GTFSPropertyCollection properties, string key, double?def = null) { string input = properties[key]; double?ret = GetNullableDouble(input); if (ret.HasValue) { return(ret.Value); } if (def.HasValue) { return(def.Value); } throw new ArgumentException($"{input} could not be cast to a number."); }
public GTFSOrderedEntity(GTFSPropertyCollection properties, string idKey, string indexKey) : base(properties, properties[idKey], properties.GetInt(indexKey)) { ID = FirstKey; Index = SecondKey; }
public FareRule(GTFSPropertyCollection properties) : base(properties) { }
public static bool IsColor(this GTFSPropertyCollection properties, string key) => IsColor(properties[key]);
public static Color GetColor(this GTFSPropertyCollection properties, string key, Color?def = null) => GetColor(properties[key], def);
public static bool?GetNullableBool(this GTFSPropertyCollection properties, string key) => GetNullableBool(properties[key]);
public static bool IsNonNegativeDouble(this GTFSPropertyCollection properties, string key) => IsNonNegativeDouble(properties[key]);
public static decimal?GetNullableNonNegativeDecimal(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeDecimal(properties[key]);
public FeedInfo(GTFSPropertyCollection properties) : base(properties) { }
public Transfer(GTFSPropertyCollection properties) : base(properties, properties["from_stop_id"], properties["to_stop_id"]) { }
public Attribution(GTFSPropertyCollection properties) : base(properties) { }
public FareAttribute(GTFSPropertyCollection properties) : base(properties, "fare_id") { }
public Trip(GTFSPropertyCollection properties) : base(properties, "trip_id") { }
public Level(GTFSPropertyCollection properties) : base(properties, "level_id") { }
public static int?GetNullableNonNegativeInt(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeInt(properties[key]);
public static Color?GetNullableColor(this GTFSPropertyCollection properties, string key) => GetNullableColor(properties[key]);
public static LocalDate?GetNullableDate(this GTFSPropertyCollection properties, string key) => GetNullableDate(properties[key]);
public static double?GetNullableNonNegativeDouble(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeDouble(properties[key]);
public static LocalDate GetDate(this GTFSPropertyCollection properties, string key, LocalDate?def = null) => GetDate(properties[key], def);
public static void AssertNonNegativeDecimal(this GTFSPropertyCollection properties, string key) => AssertDecimal(properties[key], key);
public static Duration?GetNullableDuration(this GTFSPropertyCollection properties, string key) => GetNullableDuration(properties[key]);
public static void AssertForeignKeyExists <T>(this GTFSPropertyCollection properties, string key, GTFSOrderedEntityCollection <T> collection, string collectionName) where T : GTFSOrderedEntity => AssertForeignKeyExists(properties[key], key, collection, collectionName);
public static Duration GetDuration(this GTFSPropertyCollection properties, string key, Duration?def = null) => GetDuration(properties[key], def);
public static void AssertForeignKeyExists(this GTFSPropertyCollection properties, string key, GTFSCalendarCollection collection, string collectionName) => AssertForeignKeyExists(properties[key], key, collection, collectionName);
public static bool IsDuration(this GTFSPropertyCollection properties, string key) => IsNonNegativeInt(properties[key]);
public static void AssertColor(this GTFSPropertyCollection properties, string key) => AssertColor(properties[key], key);
public static DateTimeZone GetTimeZone(this GTFSPropertyCollection properties, string key) => GetTimeZone(properties[key]);
public Agency(GTFSPropertyCollection properties) : base(properties, "agency_id") { }
public GTFSUnparsedEntity(GTFSPropertyCollection properties, Exception ex) : base(properties) { Exception = ex; }