Fluent builder for allocating a single voucher, either a specific voucher passed via voucher(Voucher) or, if none is given, the first available unallocated voucher of the builder's voucher type. Obtained from VoucherManager.newVoucherAllocationBuilder(VoucherType) and completed with build().

Group: Builders


Methods

allocatedTo(Profile p)

Returns: VoucherAllocationBuilder

Sets the profile to allocate the voucher to.

ParameterDescription
pthe recipient profile

allocatedToId(String p)

Returns: VoucherAllocationBuilder

Sets the identifier of the recipient to record on the allocated voucher.

ParameterDescription
pa user identifier string

notes(String p)

Returns: VoucherAllocationBuilder

Sets notes to record against the allocation.

ParameterDescription
pnotes to store on the voucher

voucher(Voucher p)

Returns: VoucherAllocationBuilder

Sets a specific voucher to allocate. If not set, the first available unallocated voucher of the builder's voucher type is allocated instead.

ParameterDescription
pthe specific voucher to allocate

redeemerOrg(Organisation p)

Returns: VoucherAllocationBuilder

Sets the organisation the voucher is being allocated for redemption at (e.g. a specific hotel or restaurant).

ParameterDescription
pthe redeeming organisation

excludedVoucherIds(List<Long> ids)

Returns: VoucherAllocationBuilder

Sets voucher IDs to exclude when automatically finding an available voucher to allocate.

ParameterDescription
idsinternal IDs of vouchers to exclude from the search

build()

Returns: Voucher

Executes the allocation request: allocates the specific voucher if one was set, otherwise finds and allocates an available voucher of the builder's voucher type.

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