Class SpecificItemChoice

    • Constructor Detail

      • SpecificItemChoice

        public SpecificItemChoice()
    • Method Detail

      • getVendorRef

        @Nullable
        public String getVendorRef()
      • addAttribute

        public void addAttribute​(String name,
                                 Object value)
        Takes in any additional attributes passed in the request not matching any defined properties.
        Parameters:
        name - Name of the additional attribute
        value - Value of the additional attribute
      • getAttribute

        public Map<String,​Object> getAttribute()
        Return any additional attributes passed in the request not matching any defined properties.
        Returns:
        any additional attributes passed in the request not matching any defined properties.
      • getPricingKey

        public String getPricingKey()
        System-wide unique identifier to configure specific pricing for the choice. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.
        Returns:
        a unique key to identify this choice, null if there is no external system this should be linked to for pricing data
      • getType

        public String getType()
        Whether or not this item holds a product or a variant that the customer can select from
        Returns:
        the type of this addon item
        See Also:
        DefaultSpecificItemChoiceType
      • getPriceInfo

        public com.broadleafcommerce.pricing.client.domain.PriceInfo getPriceInfo()
        Summary of the pricing information related to the choice. The consumer of this service is expecting this to be the source of truth for the pricing of this specific choice, so this field should be calculated from its own override price if present or be a copy of the underlying product's or variant's pricing to simplify the consumer's logic.
        Specified by:
        getPriceInfo in interface Priceable
        Returns:
        The PriceInfo on the entity.
        See Also:
        for special pricing considerations
      • getOverridePrice

        public javax.money.MonetaryAmount getOverridePrice()
        The specific price set for this choice that overrides the price of underlying product or variant. This is primarily used for reference in determining whether priceInfo should be disregarded in pricing calculations in this service: If there is an overridePrice, then the priceInfo received from the CatalogProvider should be used as the base for additional pricing calculations informed by the PricingProvider. Otherwise, it should be discarded since it is really a copy of the underlying product or variant and cannot be used as a basis for additional pricing calculations for the SpecificItemChoice itself.
        Returns:
        the price of this choice
      • getVariantPricing

        public Map<String,​SpecificItemChoiceVariantPricingOverride> getVariantPricing()
        Pricing overrides if specific variants of the main product this item belongs to are added to the cart. This can be used in a case like a Warranty where the price of the Warranty depends on the price of the item (Variant) selected.
        Returns:
        Pricing overrides if specific variants of the main product are added to the cart.
      • isUsingParentPricing

        public boolean isUsingParentPricing()
        Whether the priceInfo is inherited from the parent ItemChoice. This is usually determined after pricing is hydrated by the PricingProvider.
        Returns:
        Whether the priceInfo is inherited from the parent ItemChoice
      • getAttributes

        public Map<String,​Object> getAttributes()
        Map holding any additional attributes passed in the request not matching any defined properties.
      • setPricingKey

        public void setPricingKey​(String pricingKey)
        System-wide unique identifier to configure specific pricing for the choice. Relevant if pricing data is managed in a separate system or data store, like the Broadleaf pricing services.
        Parameters:
        pricingKey - a unique key to identify this choice (usually a UUID)
      • setPriceInfo

        public void setPriceInfo​(com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
        Summary of the pricing information related to the choice. The consumer of this service is expecting this to be the source of truth for the pricing of this specific choice, so this field should be calculated from its own override price if present or be a copy of the underlying product's or variant's pricing to simplify the consumer's logic.
        Specified by:
        setPriceInfo in interface Priceable
        Parameters:
        priceInfo - The PriceInfo to set.
        See Also:
        for special pricing considerations
      • setOverridePrice

        public void setOverridePrice​(javax.money.MonetaryAmount overridePrice)
        The specific price set for this choice that overrides the price of underlying product or variant. This is primarily used for reference in determining whether priceInfo should be disregarded in pricing calculations in this service: If there is an overridePrice, then the priceInfo received from the CatalogProvider should be used as the base for additional pricing calculations informed by the PricingProvider. Otherwise, it should be discarded since it is really a copy of the underlying product or variant and cannot be used as a basis for additional pricing calculations for the SpecificItemChoice itself.
        Parameters:
        overridePrice - the price of this choice
      • setVariantPricing

        public void setVariantPricing​(Map<String,​SpecificItemChoiceVariantPricingOverride> variantPricing)
        Pricing overrides if specific variants of the main product this item belongs to are added to the cart. This can be used in a case like a Warranty where the price of the Warranty depends on the price of the item (Variant) selected.
        Parameters:
        variantPricing - Pricing overrides if specific variants of the main product are added to the cart.
      • setUsingParentPricing

        public void setUsingParentPricing​(boolean usingParentPricing)
        Whether the priceInfo is inherited from the parent ItemChoice. This is usually determined after pricing is hydrated by the PricingProvider.
        Parameters:
        usingParentPricing - Whether the priceInfo is inherited from the parent ItemChoice
      • setAttributes

        public void setAttributes​(Map<String,​Object> attributes)
        Map holding any additional attributes passed in the request not matching any defined properties.
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object