Example #1
0
 public static ApplicationDTO mapRestResourceToDto(Application app, boolean useAmq) {
   ApplicationDTO appDto = new ApplicationDTO(app.getName(), useAmq);
   for (Queue queue : app.getQueues()) {
     appDto.addQueue(queue.getName());
   }
   return appDto;
 }
Example #2
0
 public static Application mapDtoToRestResource(ApplicationDTO appDto) {
   Application app = new Application();
   app.setId(appDto.getId());
   app.setName(appDto.getName());
   app.setUrl(appDto.getUrl());
   List<Queue> queues = new ArrayList<Queue>();
   for (QueueDTO qDto : appDto.getQueues()) {
     Queue q = mapDtoToRestResource(qDto);
     queues.add(q);
   }
   app.setQueues(queues);
   return app;
 }