Exemplo n.º 1
0
 private void checkUrlAndBodyForId(Long id, LunchMenuDto lunchMenuDto) {
   if (!id.equals(lunchMenuDto.getIdLunchMenu())) {
     throw new ExceptionDifferentIdBetweenUrlAndBody(
         String.format(
             "'idLunchMenu' in URL (%s) must be as same as in request body (%s).",
             id, lunchMenuDto.getIdLunchMenu()));
   }
 }
Exemplo n.º 2
0
 private void checkIdLunchMenuEmpty(LunchMenuDto lunchMenuAsDto) {
   if (!lunchMenuAsDto.getIdLunchMenu().equals(DomainUtils.NO_ID)) {
     throw new ExceptionCannotCreateLunchMenuWithId(
         String.format(
             "IdLunchMenu(%s) must be equal to %s when creating new LunchMenu.",
             lunchMenuAsDto.getIdLunchMenu(), DomainUtils.NO_ID));
   }
 }