Package com.ibm.fhir.audit.cadf.model
Class CadfGeolocation.Builder
- java.lang.Object
-
- com.ibm.fhir.audit.cadf.model.CadfGeolocation.Builder
-
- Enclosing class:
- CadfGeolocation
public static class CadfGeolocation.Builder extends Object
Builder is a convenience pattern to assemble to Java Object
-
-
Constructor Summary
Constructors Constructor Description Builder(String latitude, String longitude, Double elevation, Double accuracy)
Geolocation builder using latitude/longitude values.Builder(String city, String state, String regionICANN, Double accuracy)
Geolocation builder using city/state/region.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CadfGeolocation.Builder
accuracy(Double accuracy)
CadfGeolocation.Builder
addAnnotation(CadfMapItem annotation)
CadfGeolocation.Builder
annotations(CadfMapItem[] annotations)
Optionally set arbitrary annotations for this locationCadfGeolocation.Builder
annotations(ArrayList<CadfMapItem> annotations)
Optionally set arbitrary annotations for this locationCadfGeolocation
build()
Build an immutable geo-location objectCadfGeolocation.Builder
city(String city)
CadfGeolocation.Builder
elevation(Double elevation)
CadfGeolocation.Builder
id(String id)
Optionally set the location identifier.CadfGeolocation.Builder
latitude(String latitude)
CadfGeolocation.Builder
longitude(String longitude)
CadfGeolocation.Builder
region(String regionICANN)
Optionally add ICANN regioin data to the location created using latitude/longitude values.CadfGeolocation.Builder
state(String state)
-
-
-
Constructor Detail
-
Builder
public Builder(String latitude, String longitude, Double elevation, Double accuracy)
Geolocation builder using latitude/longitude values.- Parameters:
latitude
- -- String. Latitude values adhere to the format based on ISO 6709:2008 Annex H.3.1 – H.3.3. [ISO-6709-2008]longitude
- -- String. Longitude values adhere to the format based on ISO 6709:2008 Annex H.3.1 – H.3.3. [ISO-6709-2008]elevation
- -- Double. Elevation in meters.accuracy
- -- Double. Accuracy of geolocation, in meters.
-
Builder
public Builder(String city, String state, String regionICANN, Double accuracy)
Geolocation builder using city/state/region.- Parameters:
city
- - String. Location city.state
- - String. Location state or province, optional.regionICANN
- - String. Location region -- ICANN country code per top level domain (ccTLD) naming convention [IANA-ccTLD]. May be upper- or lowercase.accuracy
- -- Double. Accuracy of geolocation, in meters.
-
-
Method Detail
-
region
public CadfGeolocation.Builder region(String regionICANN)
Optionally add ICANN regioin data to the location created using latitude/longitude values.- Parameters:
regionICANN
- - String. ICANN country code per top level domain (ccTLD) naming convention [IANA-ccTLD]. May be upper- or lowercase.- Returns:
- Builder
-
id
public CadfGeolocation.Builder id(String id)
Optionally set the location identifier.- Parameters:
id
- - String. URI of the location.- Returns:
- This builder
-
annotations
public CadfGeolocation.Builder annotations(CadfMapItem[] annotations)
Optionally set arbitrary annotations for this location- Parameters:
annotations
- An array of key-value annotations- Returns:
- This builder
-
annotations
public CadfGeolocation.Builder annotations(ArrayList<CadfMapItem> annotations)
Optionally set arbitrary annotations for this location- Parameters:
annotations
- An array of key-value annotations- Returns:
- This builder
-
addAnnotation
public CadfGeolocation.Builder addAnnotation(CadfMapItem annotation)
-
latitude
public CadfGeolocation.Builder latitude(String latitude)
-
longitude
public CadfGeolocation.Builder longitude(String longitude)
-
state
public CadfGeolocation.Builder state(String state)
-
city
public CadfGeolocation.Builder city(String city)
-
elevation
public CadfGeolocation.Builder elevation(Double elevation)
-
accuracy
public CadfGeolocation.Builder accuracy(Double accuracy)
-
build
public CadfGeolocation build() throws IllegalStateException
Build an immutable geo-location object- Returns:
- CadfGeolocation
- Throws:
IllegalStateException
- when the properties do not meet the specification.
-
-