Interface ActiveDateEntity
- All Known Implementing Classes:
Campaign
,JpaMarketingMessage
,MarketingMessage
,Offer
,OfferCode
public interface ActiveDateEntity
This class allows for reuse of active date logic within the offer service. It was intentionally
duplicated instead of using the similar
ActiveAware
interface that is intended
to be used as part of persistence and may be subject to future change.-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
checkActiveDates
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns true if this entity is active.default boolean
checkActiveDates
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, boolean treatNullStartAsInactive, boolean treatNullEndAsInactive) Returns true if this entity is active using parameters to determine how null start or end dates impact whether the entity is active.The time at which this entity becomes inactive for storefront consumption.The time at which this entity becomes active for storefront consumption.
-
Method Details
-
getActiveStartDate
Instant getActiveStartDate()The time at which this entity becomes active for storefront consumption. Can be null, in which case the item is always active.- Returns:
- The time at which this entity becomes active for storefront consumption
-
getActiveEndDate
Instant getActiveEndDate()The time at which this entity becomes inactive for storefront consumption. Can be null, in which case the item does not expire.- Returns:
- The time at which this entity becomes inactive for storefront consumption
-
checkActiveDates
default boolean checkActiveDates(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Returns true if this entity is active. For the purpose of this interface, nulls are considered active. For some entities, it should be noted, a null start date is not considered active.- Parameters:
entity
-contextInfo
-- Returns:
-
checkActiveDates
default boolean checkActiveDates(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, boolean treatNullStartAsInactive, boolean treatNullEndAsInactive) Returns true if this entity is active using parameters to determine how null start or end dates impact whether the entity is active.- Parameters:
contextInfo
- context information around sandbox and multitenant statetreatNullStartAsInactive
- Returns false if this is true and start is nulltreatNullEndAsInactive
- Returns false if this is true and end is null- Returns:
- true if this entity is active based on passed in parameters
-