Class OfferAndOfferCodeUsageValidationResult

java.lang.Object
com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult
All Implemented Interfaces:
Serializable

public class OfferAndOfferCodeUsageValidationResult extends Object implements Serializable
DTO holding the resulting information about the validity of offers and offer code usages. This is mainly used for the purposes of holding and transferring information about the validity of offers and offer codes upon checkout.
See Also:
  • Constructor Details

    • OfferAndOfferCodeUsageValidationResult

      public OfferAndOfferCodeUsageValidationResult()
  • Method Details

    • combineValidationResults

      public void combineValidationResults(OfferAndOfferCodeUsageValidationResult result)
    • isUsageValid

      public boolean isUsageValid()
      If this is set to false, one or more offers or offer codes is no longer valid and need to be removed from the list of previously applied offers. Default is true.
      Returns:
      Whether the offer usages are valid.
    • getInvalidOfferRefIds

      public List<String> getInvalidOfferRefIds()
      The list of offer id's which are no longer valid.
      Returns:
      The list of offer id's which are no longer valid.
    • getInvalidOfferCodes

      public List<String> getInvalidOfferCodes()
      The list of offer codes which are no longer valid.
      Returns:
      The list of offer codes which are no longer valid.
    • getValidationFailureMessages

      public Map<String,String> getValidationFailureMessages()
      A map which holds pairings of Strings in invalidOfferRefIds and invalidOfferCodes as key values to messages as values which hold a description of why an offer is no longer valid.
      Returns:
      The map of error messages and their tie to an invalid offer.
    • setUsageValid

      public void setUsageValid(boolean isUsageValid)
      If this is set to false, one or more offers or offer codes is no longer valid and need to be removed from the list of previously applied offers. Default is true.
      Parameters:
      isUsageValid - Whether the offer usages are valid.
    • setInvalidOfferRefIds

      public void setInvalidOfferRefIds(List<String> invalidOfferRefIds)
      The list of offer id's which are no longer valid.
      Parameters:
      invalidOfferRefIds - The list of offer id's which are no longer valid.
    • setInvalidOfferCodes

      public void setInvalidOfferCodes(List<String> invalidOfferCodes)
      The list of offer codes which are no longer valid.
      Parameters:
      invalidOfferCodes - The list of offer codes which are no longer valid.
    • setValidationFailureMessages

      public void setValidationFailureMessages(Map<String,String> validationFailureMessages)
      A map which holds pairings of Strings in invalidOfferRefIds and invalidOfferCodes as key values to messages as values which hold a description of why an offer is no longer valid.
      Parameters:
      validationFailureMessages - The map of error messages and their tie to an invalid offer.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object