Fluent builder for creating a new auction with optional images, access restrictions, bidding rules and page body content. Obtained from AuctionManager.newAuctionBuilder and finished by calling build, which persists the configured auction.
Group: Builders
Properties
| Property | Returns | Description |
|---|---|---|
| active | AuctionBuilder | Marks the auction as active, so build gives it ACTIVE status rather than the default DRAFT. |
Methods
name(String name) · title(String title) · type(String type) · pointsBucket(Reward pointsBucket) · isActive() · group(Group group) · organisation(Organisation org) · startDate(Date startDate) · endDate(Date endDate) · description(String description) · body(String body) · image(String name, String hash) · website(Website website) · bidFee(BigDecimal bidFee) · startValue(BigDecimal startValue) · incrementValue(BigDecimal incrementValue) · sku(String sku) · auctionSet(AuctionSet auctionSet) · build()
name(String name)
Returns: AuctionBuilder
Sets the path-safe, unique name for the auction. It forms the auction's URL segment and is the key build checks for an existing auction in the current organisation, so it must not already be in use.
| Parameter | Description |
|---|---|
name | the auction's unique name |
title(String title)
Returns: AuctionBuilder
Sets the human readable title shown for the auction in listings and on its page.
| Parameter | Description |
|---|---|
title | the auction's display title |
type(String type)
Returns: AuctionBuilder
Sets the auction type, which decides how the winning bid is chosen, for example Auction.HighestBidAuction or Auction.LowestUniqueBidAuction. If left blank, build falls back to Auction.HighestBidAuction.
| Parameter | Description |
|---|---|
type | the auction type name |
pointsBucket(Reward pointsBucket)
Returns: AuctionBuilder
Sets the reward used as the auction's points bucket, which is the points balance bids are placed against. Only applied at build time if the reward has a points type.
| Parameter | Description |
|---|---|
pointsBucket | the reward acting as the auction's points bucket |
isActive()
Returns: AuctionBuilder
Marks the auction as active, so build gives it ACTIVE status rather than the default DRAFT.
group(Group group)
Returns: AuctionBuilder
Adds a group whose members are allowed to access the auction. Call it more than once to allow several groups. The groups are attached to the auction when build is called.
| Parameter | Description |
|---|---|
group | the group to grant access to, must not be null |
organisation(Organisation org)
Returns: AuctionBuilder
Adds an organisation that is allowed to access this auction.
| Parameter | Description |
|---|---|
org | the organisation to add |
startDate(Date startDate)
Returns: AuctionBuilder
Sets the date and time from which bidding on the auction is open.
| Parameter | Description |
|---|---|
startDate | the auction's start date |
endDate(Date endDate)
Returns: AuctionBuilder
Sets the date and time at which bidding on the auction closes and the winner is settled.
| Parameter | Description |
|---|---|
endDate | the auction's end date |
description(String description)
Returns: AuctionBuilder
Sets the short summary text shown for the auction. Build rejects a description longer than 2048 characters.
| Parameter | Description |
|---|---|
description | the auction's description, at most 2048 characters |
body(String body)
Returns: AuctionBuilder
Sets the HTML content that build saves as the auction's index.html page under the auctions folder. Leave it unset to create the auction without page content.
| Parameter | Description |
|---|---|
body | the HTML body content for the auction's page |
image(String name, String hash)
Returns: AuctionBuilder
Adds an image to the auction, identified by the content hash of its bytes. Call it more than once to add several images; they are attached to the auction when build is called.
| Parameter | Description |
|---|---|
name | the image's file name, must not be blank |
hash | the content hash of the image data, must not be blank |
website(Website website)
Returns: AuctionBuilder
Sets the website the auction is created against, which is the site its pages are served from.
| Parameter | Description |
|---|---|
website | the website hosting the auction |
bidFee(BigDecimal bidFee)
Returns: AuctionBuilder
Sets the fee charged to place a bid on the auction.
| Parameter | Description |
|---|---|
bidFee | the bid fee to charge |
startValue(BigDecimal startValue)
Returns: AuctionBuilder
Sets the minimum opening bid value for the auction.
| Parameter | Description |
|---|---|
startValue | the starting bid value |
incrementValue(BigDecimal incrementValue)
Returns: AuctionBuilder
Sets the minimum amount each new bid must exceed the previous bid by.
| Parameter | Description |
|---|---|
incrementValue | the minimum bid increment value |
sku(String sku)
Returns: AuctionBuilder
Sets the stock-keeping unit code for the item being auctioned.
| Parameter | Description |
|---|---|
sku | the SKU to set |
auctionSet(AuctionSet auctionSet)
Returns: AuctionBuilder
Assigns the auction to an auction set, used to group related auctions together.
| Parameter | Description |
|---|---|
auctionSet | the auction set to assign the auction to |
build()
Returns: Auction
Creates and persists the auction configured on this builder, including its images, groups, organisations and page body if any were set. Fails if an auction with the same name already exists in the current organisation.