Class CadfGeolocation.Builder
- java.lang.Object
-
- org.linuxforhealth.fhir.audit.cadf.CadfGeolocation.Builder
-
- Enclosing class:
- CadfGeolocation
public static class CadfGeolocation.Builder extends java.lang.Object
Builder is a convenience pattern to assemble to Java Object
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String latitude, java.lang.String longitude, java.lang.Double elevation, java.lang.Double accuracy)
Geolocation builder using latitude/longitude values.Builder(java.lang.String city, java.lang.String state, java.lang.String regionICANN, java.lang.Double accuracy)
Geolocation builder using city/state/region.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CadfGeolocation.Builder
accuracy(java.lang.Double accuracy)
CadfGeolocation.Builder
addAnnotation(CadfMapItem annotation)
CadfGeolocation.Builder
annotations(java.util.ArrayList<CadfMapItem> annotations)
Optionally set arbitrary annotations for this locationCadfGeolocation.Builder
annotations(CadfMapItem[] annotations)
Optionally set arbitrary annotations for this locationCadfGeolocation
build()
Build an immutable geo-location objectCadfGeolocation.Builder
city(java.lang.String city)
CadfGeolocation.Builder
elevation(java.lang.Double elevation)
CadfGeolocation.Builder
id(java.lang.String id)
Optionally set the location identifier.CadfGeolocation.Builder
latitude(java.lang.String latitude)
CadfGeolocation.Builder
longitude(java.lang.String longitude)
CadfGeolocation.Builder
region(java.lang.String regionICANN)
Optionally add ICANN regioin data to the location created using latitude/longitude values.CadfGeolocation.Builder
state(java.lang.String state)
-
-
-
Constructor Detail
-
Builder
public Builder(java.lang.String latitude, java.lang.String longitude, java.lang.Double elevation, java.lang.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(java.lang.String city, java.lang.String state, java.lang.String regionICANN, java.lang.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(java.lang.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(java.lang.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(java.util.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(java.lang.String latitude)
-
longitude
public CadfGeolocation.Builder longitude(java.lang.String longitude)
-
state
public CadfGeolocation.Builder state(java.lang.String state)
-
city
public CadfGeolocation.Builder city(java.lang.String city)
-
elevation
public CadfGeolocation.Builder elevation(java.lang.Double elevation)
-
accuracy
public CadfGeolocation.Builder accuracy(java.lang.Double accuracy)
-
build
public CadfGeolocation build() throws java.lang.IllegalStateException
Build an immutable geo-location object- Returns:
- CadfGeolocation
- Throws:
java.lang.IllegalStateException
- when the properties do not meet the specification.
-
-