Class CancellationPolicy

java.lang.Object
com.broadleafcommerce.subscription.domain.CancellationPolicy
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable

public class CancellationPolicy extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware
Describes details for access & charges in the current period in which the cancellation is being requested/executed.
Author:
karanjariwala
See Also:
  • Constructor Details

    • CancellationPolicy

      public CancellationPolicy()
  • Method Details

    • getCancellationPolicyDetail

      public CancellationPolicyDetail getCancellationPolicyDetail(String paymentStrategy)
      Gets the appropriate CancellationPolicyDetail based on the payment type used.
      Parameters:
      paymentStrategy - The payment strategy used. Can be either of prepaid or postpaid
      Returns:
      A CancellationPolicyDetail corresponding to the paymentStrategy.
    • getId

      public String getId()
      The Id of the CancellationPolicy.
    • getName

      public String getName()
      The name of the CancellationPolicy.
    • getDescription

      public String getDescription()
      The description of the CancellationPolicy.
    • getPrepaidPolicyDetail

      public CancellationPolicyDetail getPrepaidPolicyDetail()
      The CancellationPolicyDetail with details for targets using a prepaid payment strategy.
    • getPostpaidPolicyDetail

      public CancellationPolicyDetail getPostpaidPolicyDetail()
      The CancellationPolicyDetail with details for targets using a postpaid payment strategy.
    • isRequiresDirectReference

      public boolean isRequiresDirectReference()
      Whether the policy is only eligible to be used via Product or PriceData references.
    • getPolicyRules

      public String getPolicyRules()
      Policy applicability rules to identify the policy that should be used for the subscription. Utilizes a RuleBuilder.
    • getPriority

      public Integer getPriority()
      The priority of this cancellation policy. This is to enforce ordering when a subscription may match with multiple policies. A lower value indicates higher priority.
    • getAttributes

      public Map<String,Object> getAttributes()
      Contains any additional properties of a permission that do not fit in the above fields.
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • setId

      public void setId(String id)
      The Id of the CancellationPolicy.
    • setName

      public void setName(String name)
      The name of the CancellationPolicy.
    • setDescription

      public void setDescription(String description)
      The description of the CancellationPolicy.
    • setPrepaidPolicyDetail

      public void setPrepaidPolicyDetail(CancellationPolicyDetail prepaidPolicyDetail)
      The CancellationPolicyDetail with details for targets using a prepaid payment strategy.
    • setPostpaidPolicyDetail

      public void setPostpaidPolicyDetail(CancellationPolicyDetail postpaidPolicyDetail)
      The CancellationPolicyDetail with details for targets using a postpaid payment strategy.
    • setRequiresDirectReference

      public void setRequiresDirectReference(boolean requiresDirectReference)
      Whether the policy is only eligible to be used via Product or PriceData references.
    • setPolicyRules

      public void setPolicyRules(String policyRules)
      Policy applicability rules to identify the policy that should be used for the subscription. Utilizes a RuleBuilder.
    • setPriority

      public void setPriority(Integer priority)
      The priority of this cancellation policy. This is to enforce ordering when a subscription may match with multiple policies. A lower value indicates higher priority.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Contains any additional properties of a permission that do not fit in the above fields.
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
    • 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