private List<VerifiableEmail> getEmailIdentities(RegistrationRequestState currentRequest) throws EngineException { List<VerifiableEmail> emailIds = new ArrayList<>(); List<IdentityParam> identities = currentRequest.getRequest().getIdentities(); if (identities == null) return emailIds; for (IdentityParam id : identities) if (id != null && id.getTypeId().equals(EmailIdentity.ID)) emailIds.add(EmailIdentity.fromIdentityParam(id)); return emailIds; }
@Override protected void invokeWrapped( TranslationInput input, Object mvelCtx, String currentProfile, TranslationResult result) throws EngineException { Set<IdentityParam> copy = new HashSet<IdentityParam>(result.getIdentities()); for (IdentityParam i : copy) { if ((identity == null || i.getTypeId().equals(identity)) && (idValueRegexp == null || idValueRegexp.matcher(i.getValue()).matches())) { log.debug("Filtering the identity " + i.toString()); result.getIdentities().remove(i); } } }