Class CouponRequest
- java.lang.Object
-
- com.inteliqua.rest.coupon.payload.CouponBasicPayload
-
- com.inteliqua.rest.coupon.payload.CouponRequest
-
- All Implemented Interfaces:
EliquaAbstractRequestPayload
- Direct Known Subclasses:
CouponRequestPlain,CouponUpdateRequest
public abstract class CouponRequest extends CouponBasicPayload
Abstract class representing a coupon request in the system.This class serves as a base for different types of coupon requests, allowing the system to manage various actions and attributes associated with coupons. The class supports polymorphism using the
JsonTypeInfoandJsonSubTypesannotations, enabling dynamic coupon request types.- Author:
- gkonomis
-
-
Constructor Summary
Constructors Constructor Description CouponRequest()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAtrribute(EntityAttribute entityAttribute)Adds an attribute to the coupon request.StringgetAction()Gets the action to be performed on the coupon.List<EntityAttribute>getAttributes()Gets the list of attributes associated with this coupon request.StringgetCouponCode()Gets the coupon code.StringgetCouponSetCode()Gets the coupon set code.abstract StringgetType()Returns the type of the coupon request.booleanisCouponValidity()Checks if the coupon has validity dates.voidsetAction(String action)Sets the action to be performed on the coupon.voidsetCouponCode(String couponCode)Sets the coupon code.voidsetCouponSetCode(String couponSetCode)Sets the coupon set code.voidsetCouponValidity(boolean couponValidity)Sets whether the coupon has validity dates.StringtoString()Converts the coupon request to a string representation.
-
-
-
Method Detail
-
getType
public abstract String getType()
Returns the type of the coupon request.This method should be implemented by subclasses to return the specific type of the coupon request (e.g., plain, special).
- Returns:
- The coupon request type.
-
getCouponCode
public String getCouponCode()
Gets the coupon code.- Overrides:
getCouponCodein classCouponBasicPayload- Returns:
- The coupon code.
-
setCouponCode
public void setCouponCode(String couponCode)
Sets the coupon code.- Overrides:
setCouponCodein classCouponBasicPayload- Parameters:
couponCode- The coupon code to set.
-
getCouponSetCode
public String getCouponSetCode()
Gets the coupon set code.- Overrides:
getCouponSetCodein classCouponBasicPayload- Returns:
- The coupon set code.
-
setCouponSetCode
public void setCouponSetCode(String couponSetCode)
Sets the coupon set code.- Overrides:
setCouponSetCodein classCouponBasicPayload- Parameters:
couponSetCode- The coupon set code to set.
-
getAction
public String getAction()
Gets the action to be performed on the coupon.- Returns:
- The coupon action.
-
setAction
public void setAction(String action)
Sets the action to be performed on the coupon.- Parameters:
action- The action to set.
-
getAttributes
public List<EntityAttribute> getAttributes()
Gets the list of attributes associated with this coupon request.- Returns:
- The list of attributes.
-
addAtrribute
public void addAtrribute(EntityAttribute entityAttribute)
Adds an attribute to the coupon request.- Parameters:
entityAttribute- The attribute to add.
-
isCouponValidity
public boolean isCouponValidity()
Checks if the coupon has validity dates.- Returns:
trueif the coupon has validity dates;falseotherwise.
-
setCouponValidity
public void setCouponValidity(boolean couponValidity)
Sets whether the coupon has validity dates.- Parameters:
couponValidity-trueif the coupon has validity dates;falseotherwise.
-
-