use of org.mapstruct.AfterMapping in project cloud-pipeline by epam.
the class AbstractDataStorageMapper method fillS3Fields.
@AfterMapping
public void fillS3Fields(AbstractDataStorage dataStorage, @MappingTarget DataStorageVO dataStorageVO) {
if (dataStorage instanceof S3bucketDataStorage) {
S3bucketDataStorage s3bucketDataStorage = (S3bucketDataStorage) dataStorage;
dataStorageVO.setAllowedCidrs(s3bucketDataStorage.getAllowedCidrs());
dataStorageVO.setRegionId(s3bucketDataStorage.getRegionId());
}
}
use of org.mapstruct.AfterMapping in project scm-review-plugin by scm-manager.
the class ReplyMapper method appendLinks.
@AfterMapping
void appendLinks(@MappingTarget ReplyDto target, Reply source, @Context Repository repository, @Context String pullRequestId, @Context Comment comment, @Context BranchRevisionResolver.RevisionResult revisions) {
String namespace = repository.getNamespace();
String name = repository.getName();
final Links.Builder linksBuilder = new Links.Builder();
linksBuilder.self(commentPathBuilder.createReplySelfUri(namespace, name, pullRequestId, comment.getId(), target.getId()));
if (PermissionCheck.mayModifyComment(repository, source) && !source.isSystemReply()) {
linksBuilder.single(link("update", commentPathBuilder.createUpdateReplyUri(namespace, name, pullRequestId, comment.getId(), target.getId(), revisions)));
linksBuilder.single(link("delete", commentPathBuilder.createDeleteReplyUri(namespace, name, pullRequestId, comment.getId(), target.getId(), revisions)));
}
applyEnrichers(new EdisonHalAppender(linksBuilder, new Embedded.Builder()), source, repository);
target.add(linksBuilder.build());
}
Aggregations