Class MultiCodeCouponValidateInterceptor
java.lang.Object
de.hybris.platform.couponservices.interceptor.MultiCodeCouponValidateInterceptor
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<MultiCodeCouponModel>,org.springframework.beans.factory.InitializingBean
public class MultiCodeCouponValidateInterceptor
extends Object
implements ValidateInterceptor<MultiCodeCouponModel>, org.springframework.beans.factory.InitializingBean
validation interceptor for Multi-code coupon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected booleancheckActiveCoupon(MultiCodeCouponModel coupon, InterceptorContext ctx) protected voidprotected voidprotected ConfigurationServiceprotected Set<com.google.common.base.Equivalence.Wrapper<MediaModel>>getEquivalenceWrappedSet(Collection<MediaModel> seedCollection, com.google.common.base.Equivalence<MediaModel> eq) protected L10NServiceprotected <T> TgetOriginal(MultiCodeCouponModel coupon, InterceptorContext ctx, String attributeQualifier) protected booleanvoidonValidate(MultiCodeCouponModel coupon, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetConfigurationService(ConfigurationService configurationService) voidsetL10NService(L10NService l10NService)
-
Constructor Details
-
MultiCodeCouponValidateInterceptor
public MultiCodeCouponValidateInterceptor()
-
-
Method Details
-
onValidate
public void onValidate(@Nonnull MultiCodeCouponModel coupon, InterceptorContext ctx) throws InterceptorException Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor<MultiCodeCouponModel>- Parameters:
coupon- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
checkRemovalOfGeneratedCodes
protected void checkRemovalOfGeneratedCodes(MultiCodeCouponModel coupon, InterceptorContext ctx) throws CouponInterceptorException - Throws:
CouponInterceptorException- throws exception if trying to remove generated codes from multi-code coupon
-
checkSeedNumberIsNotDecremented
protected void checkSeedNumberIsNotDecremented(MultiCodeCouponModel coupon, InterceptorContext ctx) throws CouponInterceptorException - Throws:
CouponInterceptorException
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getEquivalenceWrappedSet
protected Set<com.google.common.base.Equivalence.Wrapper<MediaModel>> getEquivalenceWrappedSet(Collection<MediaModel> seedCollection, com.google.common.base.Equivalence<MediaModel> eq) -
checkActiveCoupon
-
isCodeGenerationConfigurationChanged
protected boolean isCodeGenerationConfigurationChanged(MultiCodeCouponModel model, InterceptorContext ctx) -
getOriginal
protected <T> T getOriginal(MultiCodeCouponModel coupon, InterceptorContext ctx, String attributeQualifier) -
getConfigurationService
-
setConfigurationService
-
getL10NService
-
setL10NService
-