Package com.ibm.fhir.model.type
Class Quantity.Builder
- java.lang.Object
-
- com.ibm.fhir.model.builder.AbstractBuilder<Element>
-
- com.ibm.fhir.model.type.Element.Builder
-
- com.ibm.fhir.model.type.Quantity.Builder
-
- Direct Known Subclasses:
Age.Builder,Count.Builder,Distance.Builder,Duration.Builder,MoneyQuantity.Builder,SimpleQuantity.Builder
- Enclosing class:
- Quantity
public static class Quantity.Builder extends Element.Builder
-
-
Field Summary
Fields Modifier and Type Field Description protected Codecodeprotected QuantityComparatorcomparatorprotected Urisystemprotected Stringunitprotected Decimalvalue-
Fields inherited from class com.ibm.fhir.model.type.Element.Builder
extension, id
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Quantitybuild()Build theQuantityQuantity.Buildercode(Code code)A computer processable form of the unit in some unit representation system.Quantity.Buildercomparator(QuantityComparator comparator)How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g.Quantity.Builderextension(Extension... extension)May be used to represent additional information that is not part of the basic definition of the element.Quantity.Builderextension(Collection<Extension> extension)May be used to represent additional information that is not part of the basic definition of the element.protected Quantity.Builderfrom(Quantity quantity)Quantity.Builderid(String id)Unique id for the element within a resource (for internal references).Quantity.Buildersystem(Uri system)The identification of the system that provides the coded form of the unit.Quantity.Builderunit(String unit)A human-readable form of the unit.Quantity.Buildervalue(Decimal value)The value of the measured amount.-
Methods inherited from class com.ibm.fhir.model.type.Element.Builder
from
-
-
-
-
Field Detail
-
value
protected Decimal value
-
comparator
protected QuantityComparator comparator
-
unit
protected String unit
-
system
protected Uri system
-
code
protected Code code
-
-
Method Detail
-
id
public Quantity.Builder id(String id)
Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.- Overrides:
idin classElement.Builder- Parameters:
id- Unique id for inter-element referencing- Returns:
- A reference to this Builder instance
-
extension
public Quantity.Builder extension(Extension... extension)
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.Adds new element(s) to the existing list
- Overrides:
extensionin classElement.Builder- Parameters:
extension- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
extension
public Quantity.Builder extension(Collection<Extension> extension)
May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.Replaces the existing list with a new one containing elements from the Collection
- Overrides:
extensionin classElement.Builder- Parameters:
extension- Additional content defined by implementations- Returns:
- A reference to this Builder instance
-
value
public Quantity.Builder value(Decimal value)
The value of the measured amount. The value includes an implicit precision in the presentation of the value.- Parameters:
value- Numerical value (with implicit precision)- Returns:
- A reference to this Builder instance
-
comparator
public Quantity.Builder comparator(QuantityComparator comparator)
How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.- Parameters:
comparator- < | <= | >= | > - how to understand the value- Returns:
- A reference to this Builder instance
-
unit
public Quantity.Builder unit(String unit)
A human-readable form of the unit.- Parameters:
unit- Unit representation- Returns:
- A reference to this Builder instance
-
system
public Quantity.Builder system(Uri system)
The identification of the system that provides the coded form of the unit.- Parameters:
system- System that defines coded unit form- Returns:
- A reference to this Builder instance
-
code
public Quantity.Builder code(Code code)
A computer processable form of the unit in some unit representation system.- Parameters:
code- Coded form of the unit- Returns:
- A reference to this Builder instance
-
build
public Quantity build()
Build theQuantity- Specified by:
buildin interfaceBuilder<Element>- Specified by:
buildin classElement.Builder- Returns:
- An immutable object of type
Quantity - Throws:
IllegalStateException- if the current state cannot be built into a valid Quantity per the base specification
-
from
protected Quantity.Builder from(Quantity quantity)
-
-