Search in sources :

Example 1 with BlockConfigurationV2Bean

use of org.onebusaway.api.model.transit.blocks.BlockConfigurationV2Bean in project onebusaway-application-modules by camsys.

the class BeanFactoryV2 method getBlock.

public BlockV2Bean getBlock(BlockBean block) {
    BlockV2Bean bean = new BlockV2Bean();
    bean.setId(block.getId());
    List<BlockConfigurationV2Bean> blockConfigs = new ArrayList<BlockConfigurationV2Bean>();
    for (BlockConfigurationBean blockConfig : block.getConfigurations()) blockConfigs.add(getBlockConfig(blockConfig));
    bean.setConfigurations(blockConfigs);
    return bean;
}
Also used : BlockV2Bean(org.onebusaway.api.model.transit.blocks.BlockV2Bean) ArrayList(java.util.ArrayList) BlockConfigurationBean(org.onebusaway.transit_data.model.blocks.BlockConfigurationBean) BlockConfigurationV2Bean(org.onebusaway.api.model.transit.blocks.BlockConfigurationV2Bean)

Example 2 with BlockConfigurationV2Bean

use of org.onebusaway.api.model.transit.blocks.BlockConfigurationV2Bean in project onebusaway-application-modules by camsys.

the class BeanFactoryV2 method getBlockConfig.

public BlockConfigurationV2Bean getBlockConfig(BlockConfigurationBean blockConfig) {
    BlockConfigurationV2Bean bean = new BlockConfigurationV2Bean();
    bean.setActiveServiceIds(blockConfig.getActiveServiceIds());
    bean.setInactiveServiceIds(blockConfig.getInactiveServiceIds());
    List<BlockTripV2Bean> blockTrips = new ArrayList<BlockTripV2Bean>();
    for (BlockTripBean blockTrip : blockConfig.getTrips()) blockTrips.add(getBlockTrip(blockTrip));
    bean.setTrips(blockTrips);
    return bean;
}
Also used : BlockTripBean(org.onebusaway.transit_data.model.blocks.BlockTripBean) ArrayList(java.util.ArrayList) BlockTripV2Bean(org.onebusaway.api.model.transit.blocks.BlockTripV2Bean) BlockConfigurationV2Bean(org.onebusaway.api.model.transit.blocks.BlockConfigurationV2Bean)

Aggregations

ArrayList (java.util.ArrayList)2 BlockConfigurationV2Bean (org.onebusaway.api.model.transit.blocks.BlockConfigurationV2Bean)2 BlockTripV2Bean (org.onebusaway.api.model.transit.blocks.BlockTripV2Bean)1 BlockV2Bean (org.onebusaway.api.model.transit.blocks.BlockV2Bean)1 BlockConfigurationBean (org.onebusaway.transit_data.model.blocks.BlockConfigurationBean)1 BlockTripBean (org.onebusaway.transit_data.model.blocks.BlockTripBean)1