Package com.ibm.fhir.model.type
Class Address.Builder
- java.lang.Object
-
- com.ibm.fhir.model.builder.AbstractBuilder<Element>
-
- com.ibm.fhir.model.type.Element.Builder
-
- com.ibm.fhir.model.type.Address.Builder
-
- Enclosing class:
- Address
public static class Address.Builder extends Element.Builder
-
-
Field Summary
-
Fields inherited from class com.ibm.fhir.model.type.Element.Builder
extension, id
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Addressbuild()Build theAddressAddress.Buildercity(String city)The name of the city, town, suburb, village or other community or delivery center.Address.Buildercountry(String country)Country - a nation as commonly understood or generally accepted.Address.Builderdistrict(String district)The name of the administrative area (county).Address.Builderextension(Extension... extension)May be used to represent additional information that is not part of the basic definition of the element.Address.Builderextension(Collection<Extension> extension)May be used to represent additional information that is not part of the basic definition of the element.protected Address.Builderfrom(Address address)Address.Builderid(String id)Unique id for the element within a resource (for internal references).Address.Builderline(String... line)This component contains the house number, apartment number, street name, street direction, P.O.Address.Builderline(Collection<String> line)This component contains the house number, apartment number, street name, street direction, P.O.Address.Builderperiod(Period period)Time period when address was/is in use.Address.BuilderpostalCode(String postalCode)A postal code designating a region defined by the postal service.Address.Builderstate(String state)Sub-unit of a country with limited sovereignty in a federally organized country.Address.Buildertext(String text)Specifies the entire address as it should be displayed e.g.Address.Buildertype(AddressType type)Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g.Address.Builderuse(AddressUse use)The purpose of this address.-
Methods inherited from class com.ibm.fhir.model.type.Element.Builder
from
-
-
-
-
Method Detail
-
id
public Address.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 Address.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 Address.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
-
use
public Address.Builder use(AddressUse use)
The purpose of this address.- Parameters:
use- home | work | temp | old | billing - purpose of this address- Returns:
- A reference to this Builder instance
-
type
public Address.Builder type(AddressType type)
Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.- Parameters:
type- postal | physical | both- Returns:
- A reference to this Builder instance
-
text
public Address.Builder text(String text)
Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.- Parameters:
text- Text representation of the address- Returns:
- A reference to this Builder instance
-
line
public Address.Builder line(String... line)
This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.Adds new element(s) to the existing list
- Parameters:
line- Street name, number, direction & P.O. Box etc.- Returns:
- A reference to this Builder instance
-
line
public Address.Builder line(Collection<String> line)
This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.Replaces the existing list with a new one containing elements from the Collection
- Parameters:
line- Street name, number, direction & P.O. Box etc.- Returns:
- A reference to this Builder instance
-
city
public Address.Builder city(String city)
The name of the city, town, suburb, village or other community or delivery center.- Parameters:
city- Name of city, town etc.- Returns:
- A reference to this Builder instance
-
district
public Address.Builder district(String district)
The name of the administrative area (county).- Parameters:
district- District name (aka county)- Returns:
- A reference to this Builder instance
-
state
public Address.Builder state(String state)
Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).- Parameters:
state- Sub-unit of country (abbreviations ok)- Returns:
- A reference to this Builder instance
-
postalCode
public Address.Builder postalCode(String postalCode)
A postal code designating a region defined by the postal service.- Parameters:
postalCode- Postal code for area- Returns:
- A reference to this Builder instance
-
country
public Address.Builder country(String country)
Country - a nation as commonly understood or generally accepted.- Parameters:
country- Country (e.g. can be ISO 3166 2 or 3 letter code)- Returns:
- A reference to this Builder instance
-
period
public Address.Builder period(Period period)
Time period when address was/is in use.- Parameters:
period- Time period when address was/is in use- Returns:
- A reference to this Builder instance
-
build
public Address build()
Build theAddress- Specified by:
buildin interfaceBuilder<Element>- Specified by:
buildin classElement.Builder- Returns:
- An immutable object of type
Address - Throws:
IllegalStateException- if the current state cannot be built into a valid Address per the base specification
-
from
protected Address.Builder from(Address address)
-
-