use of org.onebusaway.api.model.transit.blocks.BlockV2Bean 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;
}
use of org.onebusaway.api.model.transit.blocks.BlockV2Bean in project onebusaway-application-modules by camsys.
the class BlockAction method show.
public DefaultHttpHeaders show() throws ServiceException {
if (!isVersion(V2))
return setUnknownVersionResponse();
if (hasErrors())
return setValidationErrorsResponse();
BlockBean block = _service.getBlockForId(_id);
if (block == null)
return setResourceNotFoundResponse();
BeanFactoryV2 factory = getBeanFactoryV2();
EntryWithReferencesBean<BlockV2Bean> response = factory.getBlockResponse(block);
return setOkResponse(response);
}
Aggregations