Class FareProductFieldMappingFactory
java.lang.Object
org.onebusaway.gtfs.serialization.mappings.FareProductFieldMappingFactory
- All Implemented Interfaces:
org.onebusaway.csv_entities.schema.FieldMappingFactory
public class FareProductFieldMappingFactory
extends Object
implements org.onebusaway.csv_entities.schema.FieldMappingFactory
Fare products have a composite primary key of
- fare product id
- fare medium id (nullable)
- rider category id (nullable)
So if you want this library to look up the fare product instance you need to supply all of these,
hence we need a custom mapping factory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.onebusaway.csv_entities.schema.FieldMappingcreateFieldMapping(org.onebusaway.csv_entities.schema.EntitySchemaFactory schemaFactory, Class<?> entityType, String csvFieldName, String objFieldName, Class<?> objFieldType, boolean required) static AgencyAndIdfareProductId(String agencyId, String fareProductId, String riderCategoryId, String fareMediumId)
-
Constructor Details
-
FareProductFieldMappingFactory
public FareProductFieldMappingFactory()
-
-
Method Details
-
createFieldMapping
public org.onebusaway.csv_entities.schema.FieldMapping createFieldMapping(org.onebusaway.csv_entities.schema.EntitySchemaFactory schemaFactory, Class<?> entityType, String csvFieldName, String objFieldName, Class<?> objFieldType, boolean required) - Specified by:
createFieldMappingin interfaceorg.onebusaway.csv_entities.schema.FieldMappingFactory
-
fareProductId
public static AgencyAndId fareProductId(String agencyId, String fareProductId, String riderCategoryId, String fareMediumId)
-