Class DefaultB2BAccountAddressValidator<P extends AccountAddress>

    • Constructor Detail

      • DefaultB2BAccountAddressValidator

        public DefaultB2BAccountAddressValidator()
    • Method Detail

      • supports

        public boolean supports​(Class<?> serviceClass,
                                com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Specified by:
        supports in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
      • validate

        public void validate​(@NonNull
                             @NonNull Object entity,
                             @NonNull
                             @NonNull org.springframework.validation.Errors errors,
                             @Nullable
                             com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
        Specified by:
        validate in interface com.broadleafcommerce.data.tracking.core.mapping.validation.EntityValidator
      • validateBillToAddress

        protected void validateBillToAddress​(@NonNull
                                             @NonNull AccountAddress accountAddress,
                                             @NonNull
                                             @NonNull org.springframework.validation.Errors errors)
        Guarantee that B2B "Bill To" AccountAddresses have an email address & primary phone number
        Parameters:
        accountAddress - the AccountAddress to validate
        errors - the errors object bound to the accountAddress on which errors can be registered