Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. class DeveloperValidation implements Validation {
  2. @Override
  3. public void validate(ControllerDocumentType document, DocumentContext docCtx) {
  4. if (document.getDocsCo().getDocId() == null)
  5. return;
  6. DocumentEntity entity = documentRepository.get(document.getDocsCo().getDocId());
  7. if (document.getDocsCo().getDeveloperOgrn().equals(entity.getDeveloper().getOgrn().toString()))
  8. return;
  9. throw CodifiedException.buildClientAvailable(String.format("Недопустимое значение атрибута [developer_ogrn]. Ожидаемое значение [%s]", entity.getDeveloper().getOgrn()));
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement