use of org.onebusaway.api.model.transit.blocks.BlockInstanceV2Bean in project onebusaway-application-modules by camsys.
the class BlockInstanceAction method show.
public DefaultHttpHeaders show() throws ServiceException {
if (!isVersion(V2))
return setUnknownVersionResponse();
if (hasErrors())
return setValidationErrorsResponse();
BlockInstanceBean blockInstance = _service.getBlockInstance(_id, _serviceDate);
if (blockInstance == null)
return setResourceNotFoundResponse();
BeanFactoryV2 factory = getBeanFactoryV2();
BlockInstanceV2Bean bean = factory.getBlockInstance(blockInstance);
EntryWithReferencesBean<BlockInstanceV2Bean> response = factory.entry(bean);
return setOkResponse(response);
}
use of org.onebusaway.api.model.transit.blocks.BlockInstanceV2Bean in project onebusaway-application-modules by camsys.
the class BeanFactoryV2 method getBlockInstance.
public BlockInstanceV2Bean getBlockInstance(BlockInstanceBean blockInstance) {
BlockInstanceV2Bean bean = new BlockInstanceV2Bean();
bean.setBlockConfiguration(getBlockConfig(blockInstance.getBlockConfiguration()));
bean.setBlockId(blockInstance.getBlockId());
bean.setServiceDate(blockInstance.getServiceDate());
return bean;
}
Aggregations