One selectable value of a product parameter, for example Black or White for a "Colour" parameter. Each option belongs to exactly one ProductParameter, which in turn belongs to a product, and the set of options is what a shopper chooses between when configuring that product. An option may carry its own incremental cost and its own image, so the same product can be priced and pictured differently depending on which options are selected.

Group: Database Entities

Implements: Serializable


Properties

PropertyReturnsDescription
costBigDecimalThe incremental cost of choosing this option, added to the product's base cost. May be null, which means the option does not affect price and the cost comes from the product alone. The value may be negative to make an option cheaper. Where several options are selected their costs are all added, so an iphone at 500 with colour gold at 100 and size 32Gb at 50 comes to 650.
idlongThe database identifier of this parameter option.
imageHashStringContent hash of an image illustrating this option, for example a swatch of the colour. Resolve it through the content repository to render the image. Null when no image has been set.
nameStringThe identifier for this option within its parameter, such as "green" or a SKU fragment. Use this when matching a selection made by a shopper; the human readable label is the title. Never null for a persisted option.
positionIntegerSort order of this option when the parameter's options are listed for selection, used to keep naturally ordered values such as S, M, L, XL in sequence rather than alphabetical. Null when no explicit ordering has been given.
productParameterProductParameterThe parameter this option belongs to, such as the "Colour" or "Size" parameter of a product. Never null for a persisted option.
titleStringThe display label shown to shoppers for this option, such as "Lime Green". This is free text with no uniqueness guarantee, unlike the name. Never null for a persisted option.

Methods

getId() · getProductParameter() · getName() · setName(String name) · getTitle() · setTitle(String title) · getCost() · setCost(BigDecimal cost) · getImageHash() · setImageHash(String imageHash) · getPosition() · setPosition(Integer position)

getId()

Returns: long

The database identifier of this parameter option.

getProductParameter()

Returns: ProductParameter

The parameter this option belongs to, such as the "Colour" or "Size" parameter of a product. Never null for a persisted option.

getName()

Returns: String

The identifier for this option within its parameter, such as "green" or a SKU fragment. Use this when matching a selection made by a shopper; the human readable label is the title. Never null for a persisted option.

setName(String name)

Returns: void

Sets the identifier for this option within its parameter.

ParameterDescription
namethe option's identifying name, such as "green" or a SKU fragment

getTitle()

Returns: String

The display label shown to shoppers for this option, such as "Lime Green". This is free text with no uniqueness guarantee, unlike the name. Never null for a persisted option.

setTitle(String title)

Returns: void

Sets the display label shown to shoppers for this option.

ParameterDescription
titlethe option's display label, such as "Lime Green"

getCost()

Returns: BigDecimal

The incremental cost of choosing this option, added to the product's base cost. May be null, which means the option does not affect price and the cost comes from the product alone. The value may be negative to make an option cheaper. Where several options are selected their costs are all added, so an iphone at 500 with colour gold at 100 and size 32Gb at 50 comes to 650.

setCost(BigDecimal cost)

Returns: void

Sets the incremental cost added to the product's base cost when this option is chosen.

ParameterDescription
costthe incremental cost, which may be negative, or null for no price effect

getImageHash()

Returns: String

Content hash of an image illustrating this option, for example a swatch of the colour. Resolve it through the content repository to render the image. Null when no image has been set.

setImageHash(String imageHash)

Returns: void

Sets the content hash of the image illustrating this option.

ParameterDescription
imageHashthe image content hash, or null to remove the image

getPosition()

Returns: Integer

Sort order of this option when the parameter's options are listed for selection, used to keep naturally ordered values such as S, M, L, XL in sequence rather than alphabetical. Null when no explicit ordering has been given.

setPosition(Integer position)

Returns: void

Sets the sort order of this option when the parameter's options are listed.

ParameterDescription
positionthe sort position, or null to leave the options unordered
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.