public class Location extends BaseOpenmrsMetadata implements Serializable, Attributable<Location>, Address
LocationTags.| Modifier and Type | Field and Description |
|---|---|
static int |
LOCATION_UNKNOWN |
static long |
serialVersionUID |
| Constructor and Description |
|---|
Location()
default constructor
|
Location(Integer locationId)
constructor with id
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChildLocation(Location child) |
void |
addTag(LocationTag tag)
Attaches a tag to the Location.
|
boolean |
equals(Object obj)
Compares two objects for similarity
|
List<Location> |
findPossibleValues(String searchText)
Search for possible values of this object using the given search string
|
String |
getAddress1() |
String |
getAddress2() |
String |
getAddress3() |
String |
getAddress4() |
String |
getAddress5() |
String |
getAddress6() |
Set<Location> |
getChildLocations() |
Set<Location> |
getChildLocations(boolean includeRetired)
Returns all childLocations where child.locationId = this.locationId.
|
String |
getCityVillage() |
String |
getCountry() |
String |
getCountyDistrict() |
String |
getDisplayString()
Gets a descriptive String used for display purposes This is meant as an alternative to using
the toString() to display this object to a user
|
Integer |
getId() |
String |
getLatitude() |
Integer |
getLocationId() |
String |
getLongitude() |
String |
getNeighborhoodCell()
Deprecated.
As of 1.8, replaced by
getAddress3() |
Location |
getParentLocation() |
List<Location> |
getPossibleValues()
Find all possible values of this object.
|
String |
getPostalCode() |
String |
getRegion()
Deprecated.
As of 1.8, replaced by
getAddress6() |
String |
getStateProvince() |
String |
getSubregion()
Deprecated.
As of 1.8, replaced by
getAddress5() |
Set<LocationTag> |
getTags() |
String |
getTownshipDivision()
Deprecated.
As of 1.8, replaced by
getAddress4() |
int |
hashCode() |
Boolean |
hasTag(String tagToFind)
Checks whether the Location has a particular tag.
|
Location |
hydrate(String locationId)
Deserialize the given string into a full object
|
static Boolean |
isInHierarchy(Location location,
Location root)
Checks whether 'location' is a member of the tree starting at 'root'.
|
void |
removeChildLocation(Location child) |
void |
removeTag(LocationTag tag)
Remove the tag from the Location.
|
String |
serialize()
Turn the current object into an identifying string that can be retrieved later
|
void |
setAddress1(String address1) |
void |
setAddress2(String address2) |
void |
setAddress3(String address3) |
void |
setAddress4(String address4) |
void |
setAddress5(String address5) |
void |
setAddress6(String address6) |
void |
setChildLocations(Set<Location> childLocations) |
void |
setCityVillage(String cityVillage) |
void |
setCountry(String country) |
void |
setCountyDistrict(String countyDistrict) |
void |
setId(Integer id) |
void |
setLatitude(String latitude) |
void |
setLocationId(Integer locationId) |
void |
setLongitude(String longitude) |
void |
setNeighborhoodCell(String address3)
Deprecated.
As of 1.8, replaced by
setAddress3(String) |
void |
setParentLocation(Location parentLocationId) |
void |
setPostalCode(String postalCode) |
void |
setRegion(String address6)
Deprecated.
As of 1.8, replaced by
setAddress6(String) |
void |
setStateProvince(String stateProvince) |
void |
setSubregion(String address5)
Deprecated.
As of 1.8, replaced by
setAddress5(String) |
void |
setTags(Set<LocationTag> tags)
Set the tags which are attached to this Location.
|
void |
setTownshipDivision(String address4)
Deprecated.
As of 1.8, replaced by
setAddress4(String) |
String |
toString() |
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReasongetUuid, setUuidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetUuid, setUuidpublic static final long serialVersionUID
public static final int LOCATION_UNKNOWN
public Location()
public Location(Integer locationId)
public boolean equals(Object obj)
public String getAddress1()
getAddress1 in interface Addresspublic void setAddress1(String address1)
setAddress1 in interface Addressaddress1 - The address1 to set.public String getAddress2()
getAddress2 in interface Addresspublic void setAddress2(String address2)
setAddress2 in interface Addressaddress2 - The address2 to set.public String getCityVillage()
getCityVillage in interface Addresspublic void setCityVillage(String cityVillage)
setCityVillage in interface AddresscityVillage - The cityVillage to set.public String getCountry()
getCountry in interface Addresspublic void setCountry(String country)
setCountry in interface Addresscountry - The country to set.public String getLatitude()
getLatitude in interface Addresspublic void setLatitude(String latitude)
setLatitude in interface Addresslatitude - The latitude to set.public Integer getLocationId()
public void setLocationId(Integer locationId)
locationId - The locationId to set.public String getLongitude()
getLongitude in interface Addresspublic void setLongitude(String longitude)
setLongitude in interface Addresslongitude - The longitude to set.public String getPostalCode()
getPostalCode in interface Addresspublic void setPostalCode(String postalCode)
setPostalCode in interface AddresspostalCode - The postalCode to set.public String getStateProvince()
getStateProvince in interface Addresspublic void setStateProvince(String stateProvince)
setStateProvince in interface AddressstateProvince - The stateProvince to set.public String getCountyDistrict()
getCountyDistrict in interface Addresspublic void setCountyDistrict(String countyDistrict)
setCountyDistrict in interface AddresscountyDistrict - The countyDistrict to set.@Deprecated public String getNeighborhoodCell()
getAddress3()@Deprecated public void setNeighborhoodCell(String address3)
setAddress3(String)address3 - The neighborhoodCell to set.public List<Location> findPossibleValues(String searchText)
AttributablefindPossibleValues in interface Attributable<Location>searchText - String to search onAttributable.findPossibleValues(java.lang.String)public List<Location> getPossibleValues()
AttributablegetPossibleValues in interface Attributable<Location>Attributable.getPossibleValues()public Location hydrate(String locationId)
Attributablehydrate in interface Attributable<Location>locationId - String to deserializeAttributable.hydrate(java.lang.String)public String serialize()
Attributableserialize in interface Attributable<Location>Attributable.serialize()public String getDisplayString()
AttributablegetDisplayString in interface Attributable<Location>Attributable.getDisplayString()@Deprecated public String getRegion()
getAddress6()@Deprecated public void setRegion(String address6)
setAddress6(String)address6 - the region to set@Deprecated public String getSubregion()
getAddress5()@Deprecated public void setSubregion(String address5)
setAddress5(String)address5 - the subregion to set@Deprecated public String getTownshipDivision()
getAddress4()@Deprecated public void setTownshipDivision(String address4)
setAddress4(String)address4 - the townshipDivision to setpublic Location getParentLocation()
public void setParentLocation(Location parentLocationId)
parentLocationId - The parentLocation to set.public Set<Location> getChildLocations()
public Set<Location> getChildLocations(boolean includeRetired)
includeRetired - specifies whether or not to include voided childLocationspublic void setChildLocations(Set<Location> childLocations)
childLocations - The childLocations to set.public void addChildLocation(Location child)
child - The child location to add.public static Boolean isInHierarchy(Location location, Location root)
location - The location to be tested.root - Location node from which to start the testing (down in the hierarchy).public void removeChildLocation(Location child)
child - The child location to remove.public Set<LocationTag> getTags()
public void setTags(Set<LocationTag> tags)
tags - The tags to set.public void addTag(LocationTag tag)
tag - The tag to add.public void removeTag(LocationTag tag)
tag - The tag to remove.public Boolean hasTag(String tagToFind)
tagToFind - the string of the tag for which to checkpublic String getAddress3()
getAddress3 in interface Addresspublic void setAddress3(String address3)
setAddress3 in interface Addressaddress3 - the address3 to setpublic String getAddress4()
getAddress4 in interface Addresspublic void setAddress4(String address4)
setAddress4 in interface Addressaddress4 - the address4 to setpublic String getAddress6()
getAddress6 in interface Addresspublic void setAddress6(String address6)
setAddress6 in interface Addressaddress6 - the address6 to setpublic String getAddress5()
getAddress5 in interface Addresspublic void setAddress5(String address5)
setAddress5 in interface Addressaddress5 - the address5 to setpublic Integer getId()
getId in interface OpenmrsObjectOpenmrsObject.getId()public void setId(Integer id)
setId in interface OpenmrsObjectid - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)Copyright © 2018 OpenMRS LLC.. All Rights Reserved.