Fluent builder for constructing and submitting a new RewardEntry, recording that a profile has entered or been awarded a promotion. Configure the desired fields with the setter methods (both the fluent with-style methods and the plain getX/setX pairs are provided for the same fields), then call build to persist the entry. Obtained from PromotionsManager.newRewardEntryBuilder.

Group: Builders


Properties

PropertyReturnsDescription
attachmentHashStringThe content hash of the file attached to this entry, if set.
awardedDateDateThe date the entry is awarded on, if set.
awardedForModuleStatusThe module status this entry was awarded for, if the entry was triggered by completing a module.
awardedToProfileThe profile this entry is being awarded to, as given when the builder was created.
firstNameStringThe first name recorded for this entry, if set.
reasonStringThe reason recorded for this entry, if set.
relatedCartCartThe cart related to this entry, if set.
relatedOrgOrganisationThe organisation related to this entry, if one has been set.
relatedProductSkuProductSkuThe product sku related to this entry, if one has been set.
rewardRewardThe promotion this entry is being submitted for, as given when the builder was created.
statusRewardEntryStatusThe approval status this entry will be created with, if explicitly set.
surNameStringThe surname recorded for this entry, if set.

Methods

getReward() · relatedProductSku(ProductSku s) · reason(String s) · awardedDate(Date s) · attachmentHash(String s) · firstName(String s) · surName(String s) · relatedCart(Cart s) · status(RewardEntryStatus status) · getAwardedFor() · setAwardedFor(ModuleStatus awardedFor) · getRelatedOrg() · setRelatedOrg(Organisation relatedOrg) · getRelatedProductSku() · setRelatedProductSku(ProductSku relatedProductSku) · getAwardedTo() · getAwardedDate() · setAwardedDate(Date awardedDate) · getReason() · setReason(String reason) · getAttachmentHash() · setAttachmentHash(String attachmentHash) · getRelatedCart() · setRelatedCart(Cart relatedCart) · getFirstName() · setFirstName(String firstName) · getSurName() · setSurName(String surName) · getStatus() · setStatus(RewardEntryStatus status) · addAnswer(String name, String value) · addAnswerFile(String name, FileItem fileItem) · extraField1(String extraField) · extraField2(String extraField) · extraField3(String extraField) · build()

getReward()

Returns: Reward

The promotion this entry is being submitted for, as given when the builder was created.

relatedProductSku(ProductSku s)

Returns: RewardEntryBuilder

Sets the product sku related to this entry.

ParameterDescription
sthe related product sku

reason(String s)

Returns: RewardEntryBuilder

Sets the reason recorded for this entry.

ParameterDescription
sthe reason text

awardedDate(Date s)

Returns: RewardEntryBuilder

Sets the date the entry is awarded on. If not set, submitEntry uses the current date.

ParameterDescription
sthe awarded date

attachmentHash(String s)

Returns: RewardEntryBuilder

Sets the content hash of a file attached to this entry.

ParameterDescription
sthe attachment hash

firstName(String s)

Returns: RewardEntryBuilder

Sets the first name recorded for this entry. If not set, build uses the awarded profile's first name.

ParameterDescription
sthe first name

surName(String s)

Returns: RewardEntryBuilder

Sets the surname recorded for this entry. If not set, build uses the awarded profile's surname.

ParameterDescription
sthe surname

relatedCart(Cart s)

Returns: RewardEntryBuilder

Sets the cart related to this entry, when the entry is awarded as part of a checkout.

ParameterDescription
sthe related cart

status(RewardEntryStatus status)

Returns: RewardEntryBuilder

Sets the approval status the entry will be created with. If not set, build defaults it based on whether the promotion requires approval.

ParameterDescription
statusthe approval status

getAwardedFor()

Returns: ModuleStatus

The module status this entry was awarded for, if the entry was triggered by completing a module.

setAwardedFor(ModuleStatus awardedFor)

Returns: void

Sets the module status this entry is awarded for.

ParameterDescription
awardedForthe related module status

getRelatedOrg()

Returns: Organisation

The organisation related to this entry, if one has been set.

setRelatedOrg(Organisation relatedOrg)

Returns: void

Sets the organisation related to this entry.

ParameterDescription
relatedOrgthe related organisation

getRelatedProductSku()

Returns: ProductSku

The product sku related to this entry, if one has been set.

setRelatedProductSku(ProductSku relatedProductSku)

Returns: void

Sets the product sku related to this entry.

ParameterDescription
relatedProductSkuthe related product sku

getAwardedTo()

Returns: Profile

The profile this entry is being awarded to, as given when the builder was created.

getAwardedDate()

Returns: Date

The date the entry is awarded on, if set.

setAwardedDate(Date awardedDate)

Returns: void

Sets the date the entry is awarded on.

ParameterDescription
awardedDatethe awarded date

getReason()

Returns: String

The reason recorded for this entry, if set.

setReason(String reason)

Returns: void

Sets the reason recorded for this entry.

ParameterDescription
reasonthe reason text

getAttachmentHash()

Returns: String

The content hash of the file attached to this entry, if set.

setAttachmentHash(String attachmentHash)

Returns: void

Sets the content hash of a file attached to this entry.

ParameterDescription
attachmentHashthe attachment hash

getRelatedCart()

Returns: Cart

The cart related to this entry, if set.

setRelatedCart(Cart relatedCart)

Returns: void

Sets the cart related to this entry.

ParameterDescription
relatedCartthe related cart

getFirstName()

Returns: String

The first name recorded for this entry, if set.

setFirstName(String firstName)

Returns: void

Sets the first name recorded for this entry.

ParameterDescription
firstNamethe first name

getSurName()

Returns: String

The surname recorded for this entry, if set.

setSurName(String surName)

Returns: void

Sets the surname recorded for this entry.

ParameterDescription
surNamethe surname

getStatus()

Returns: RewardEntryStatus

The approval status this entry will be created with, if explicitly set.

setStatus(RewardEntryStatus status)

Returns: void

Sets the approval status this entry will be created with.

ParameterDescription
statusthe approval status

addAnswer(String name, String value)

Returns: RewardEntryBuilder

Records a text answer to a quiz question for this entry.

ParameterDescription
namethe answer key
valuethe given answer text

addAnswerFile(String name, FileItem fileItem)

Returns: RewardEntryBuilder

Records a file answer to a quiz question for this entry. The file is uploaded and stored when the entry is built.

ParameterDescription
namethe answer key
fileItemthe uploaded file

extraField1(String extraField)

Returns: RewardEntryBuilder

Set extra field 1 for this reward entry.

ParameterDescription
extraFieldas {@code String}

extraField2(String extraField)

Returns: RewardEntryBuilder

Set extra field 2 for this reward entry.

ParameterDescription
extraFieldas {@code String}

extraField3(String extraField)

Returns: RewardEntryBuilder

Set extra field 3 for this reward entry.

ParameterDescription
extraFieldas {@code String}

build()

Returns: RewardEntry

Validates and submits this builder, creating and persisting the RewardEntry (and any quiz submission records) via PromotionsManager.submitEntry.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.