Class: DemandBodyBuilder
market/demand/demand-body-builder.DemandBodyBuilder
A helper class assisting in building the Golem Demand object
Various directors should use the builder to add properties and constraints before the final product is received from the builder and sent to yagna to subscribe for matched offers (proposals).
The main purpose of the builder is to accept different requirements (properties and constraints) from different directors who know what kind of properties and constraints are needed. Then it helps to merge these requirements.
Demand -> DemandSpecification -> DemandPrototype -> DemandDTO
Table of contents
Constructors
Methods
Constructors
constructor
• new DemandBodyBuilder(): DemandBodyBuilder
Returns
Methods
addProperty
▸ addProperty(key
, value
): DemandBodyBuilder
Parameters
Name | Type |
---|---|
key | string |
value | DemandPropertyValue |
Returns
Defined in
src/market/demand/demand-body-builder.ts:60
addConstraint
▸ addConstraint(key
, value
, comparisonOperator?
): DemandBodyBuilder
Parameters
Name | Type | Default value |
---|---|---|
key | string | undefined |
value | string | number | undefined |
comparisonOperator | ComparisonOperator | ComparisonOperator.Eq |
Returns
Defined in
src/market/demand/demand-body-builder.ts:70
getProduct
▸ getProduct(): DemandBodyPrototype
Returns
Defined in
src/market/demand/demand-body-builder.ts:75
mergePrototype
▸ mergePrototype(prototype
): DemandBodyBuilder
Parameters
Name | Type |
---|---|
prototype | DemandBodyPrototype |
Returns
Defined in
Was this helpful?