Fluent builder for a points expiry rule type contributed by an app, reached from controllerMappings.pointsExpiryRuleTypeBuilder(id, title). A points expiry rule type decides when a member's accrued points expire. Add any configuration fields shown to admins with addField, set the JS function that calculates the expiry date with processFn, then call build to create and register the rule type for use in points programmes.
Group: Builders
Methods
processFn(String s)
Returns: PointsExpiryRuleTypeBuilder
Sets the name of the JS function called to calculate a member's points expiry date under this rule type.
| Parameter | Description |
|---|---|
s | the JS function name |
addField(String name, String title)
Returns: PointsExpiryRuleTypeBuilder
Adds a configuration field shown to admins with the given title and no help text, using its default input type.
| Parameter | Description |
|---|---|
name | the field's name |
title | the field's display title |
addField(String name, String text, String title)
Returns: PointsExpiryRuleTypeBuilder
Adds a configuration field shown to admins with the given title and help text, using its default input type.
| Parameter | Description |
|---|---|
name | the field's name |
text | help text shown alongside the field |
title | the field's display title |
addField(String name, String text, String title, String options)
Returns: PointsExpiryRuleTypeBuilder
Adds a configuration field, parsing its input type, requirement and selectable options from the compact options string (see ExtraField.parse for the format).
| Parameter | Description |
|---|---|
name | the field's name |
text | help text shown alongside the field, may be null |
title | the field's display title |
options | the semicolon-separated field configuration string, may be null |
addField(String name, String text, String title, boolean required, List<String> options)
Returns: PointsExpiryRuleTypeBuilder
Adds a configuration field with an explicit requirement flag and a fixed list of selectable options.
| Parameter | Description |
|---|---|
name | the field's name |
text | help text shown alongside the field, may be null |
title | the field's display title |
required | whether the field must be given a value |
options | the selectable option values for the field |
addFieldWithOptionsFn(String name, String text, String title, boolean required, Supplier<List<String>> optionsFn)
Returns: PointsExpiryRuleTypeBuilder
Adds a configuration field with an explicit requirement flag, whose selectable options are computed on demand by the given supplier rather than fixed up front.
| Parameter | Description |
|---|---|
name | the field's name |
text | help text shown alongside the field, may be null |
title | the field's display title |
required | whether the field must be given a value |
optionsFn | supplier that computes the field's selectable option values |
build()
Returns: JsPointsExpiryRuleType
Builds the points expiry rule type from the values set on this builder and registers it with the app's controller mapping list for use in points programmes.