Search in sources :

Example 6 with IdentityBean

use of org.onebusaway.gtfs.model.IdentityBean in project onebusaway-gtfs-modules by OneBusAway.

the class EntityFieldMappingImpl method translateFromObjectToCSV.

@SuppressWarnings("unchecked")
public void translateFromObjectToCSV(CsvEntityContext context, BeanWrapper object, Map<String, Object> csvValues) {
    IdentityBean<AgencyAndId> entity = (IdentityBean<AgencyAndId>) object.getPropertyValue(_objFieldName);
    if (isOptional() && entity == null)
        return;
    AgencyAndId id = entity.getId();
    csvValues.put(_csvFieldName, id.getId());
}
Also used : AgencyAndId(org.onebusaway.gtfs.model.AgencyAndId) IdentityBean(org.onebusaway.gtfs.model.IdentityBean)

Aggregations

IdentityBean (org.onebusaway.gtfs.model.IdentityBean)6 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)4 Converter (org.apache.commons.beanutils.Converter)2 Serializable (java.io.Serializable)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Max (org.onebusaway.collections.Max)1 GtfsReaderContext (org.onebusaway.gtfs.serialization.GtfsReaderContext)1 GtfsMutableRelationalDao (org.onebusaway.gtfs.services.GtfsMutableRelationalDao)1 IdKeyMatch (org.onebusaway.gtfs_transformer.collections.IdKeyMatch)1 EntityMatch (org.onebusaway.gtfs_transformer.match.EntityMatch)1 TypedEntityMatch (org.onebusaway.gtfs_transformer.match.TypedEntityMatch)1