Class ProductRestriction

    • Constructor Detail

      • ProductRestriction

        public ProductRestriction()
    • Method Detail

      • getMessageAttributeValues

        protected java.lang.String[] getMessageAttributeValues()
        Description copied from class: Restriction
        Returns the values for making violation messages more useful.
        Overrides:
        getMessageAttributeValues in class Restriction
      • getProductNames

        protected java.lang.String getProductNames()
        Returns the names of all products restricted by this restriction.
        Returns:
        a String representing a comma separated list of product names.
      • isFulfilledInternal

        protected boolean isFulfilledInternal​(AbstractOrder anOrder)
        Returns true if the specified abstract order fulfills this restriction. More formally, returns true if the specified abstract order contains at least one product that fulfills this restriction.
        Specified by:
        isFulfilledInternal in class Restriction
        Parameters:
        anOrder - the abstract order to check whether it fulfills this restriction.
        Returns:
        true if the specified abstract order fulfills this restriction, false else.
        See Also:
        Restriction.isFulfilledInternal(AbstractOrder)
      • isFulfilledInternal

        protected boolean isFulfilledInternal​(Product aProduct)
        Returns true if the specified product fulfills this restriction. More formally, returns true if the set of products defined by this restriction contains the specified product, such that (getProducts().contains(aProduct)==isPositive().booleanValue()).
        Specified by:
        isFulfilledInternal in class Restriction
        Parameters:
        aProduct - the product to check whether it fulfills this restriction.
        Returns:
        true if the specified product fulfills this restriction, false else.
        See Also:
        Restriction.isFulfilledInternal(Product)