private SyncopeClientException checkMandatory(final Any<?> any, final AnyUtils anyUtils) {
SyncopeClientException reqValMissing = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing);
AllowedSchemas<PlainSchema> allowedPlainSchemas = anyUtils.dao().findAllowedSchemas(any, PlainSchema.class);
allowedPlainSchemas.getForSelf().forEach(schema -> {
checkMandatory(schema, any.getPlainAttr(schema.getKey()).orElse(null), any, reqValMissing);
});
if (any instanceof GroupableRelatable) {
allowedPlainSchemas.getForMemberships().forEach((group, schemas) -> {
GroupableRelatable<?, ?, ?, ?, ?> groupable = GroupableRelatable.class.cast(any);
Membership<?> membership = groupable.getMembership(group.getKey()).orElse(null);
schemas.forEach(schema -> {
checkMandatory(schema, groupable.getPlainAttr(schema.getKey(), membership).orElse(null),
any, reqValMissing);
});
});
}
return reqValMissing;
}