Skip to content

Commit

Permalink
Define props mapper bean
Browse files Browse the repository at this point in the history
  • Loading branch information
pavetok committed Oct 14, 2023
1 parent 67e58b7 commit cfdcca7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
import smecalculus.bezmen.validation.EdgeValidator;
import smecalculus.bezmen.validation.EdgeValidatorHibernateValidator;
import smecalculus.bezmen.validation.ValidationPropsMapper;
import smecalculus.bezmen.validation.ValidationPropsMapperImpl;

@Configuration(proxyBeanMethods = false)
public class ValidationBeans {

private static final Logger LOG = LoggerFactory.getLogger(ValidationBeans.class);

@Bean
ValidationPropsMapper validationPropsMapper() {
return new ValidationPropsMapperImpl();
}

@Bean
ValidationProps validationProps(PropsKeeper keeper, ValidationPropsMapper mapper) {
var propsEdge = keeper.read("bezmen.validation", ValidationPropsEdge.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package smecalculus.bezmen.validation;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import smecalculus.bezmen.configuration.ValidationMode;
import smecalculus.bezmen.configuration.ValidationProps;
import smecalculus.bezmen.configuration.ValidationPropsEdge;

@Mapper
public interface ValidationPropsMapper {
@Mapping(source = "mode", target = "validationMode")
ValidationProps toDomain(ValidationPropsEdge propsEdge);
Expand Down

0 comments on commit cfdcca7

Please sign in to comment.