public class Location extends BaseCustomizableMetadata<LocationAttribute> implements java.io.Serializable, Attributable<Location>, Address
LocationTag
s.
Note: Prior to version 1.9 this class extended BaseMetadataModifier and Type | Field and Description |
---|---|
static int |
LOCATION_UNKNOWN |
static long |
serialVersionUID |
Constructor and Description |
---|
Location()
default constructor
|
Location(java.lang.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.
|
java.util.List<Location> |
findPossibleValues(java.lang.String searchText)
Search for possible values of this object using the given search string
|
java.lang.String |
getAddress1() |
java.lang.String |
getAddress2() |
java.lang.String |
getAddress3() |
java.lang.String |
getAddress4() |
java.lang.String |
getAddress5() |
java.lang.String |
getAddress6() |
java.util.Set<Location> |
getChildLocations() |
java.util.Set<Location> |
getChildLocations(boolean includeRetired)
Returns all childLocations where child.locationId = this.locationId.
|
java.lang.String |
getCityVillage() |
java.lang.String |
getCountry() |
java.lang.String |
getCountyDistrict() |
java.lang.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
|
java.lang.Integer |
getId() |
java.lang.String |
getLatitude() |
java.lang.Integer |
getLocationId() |
java.lang.String |
getLongitude() |
java.lang.String |
getNeighborhoodCell()
Deprecated.
As of 1.8, replaced by
getAddress3() |
Location |
getParentLocation() |
java.util.List<Location> |
getPossibleValues()
Find all possible values of this object.
|
java.lang.String |
getPostalCode() |
java.lang.String |
getRegion()
Deprecated.
As of 1.8, replaced by
getAddress6() |
java.lang.String |
getStateProvince() |
java.lang.String |
getSubregion()
Deprecated.
As of 1.8, replaced by
getAddress5() |
java.util.Set<LocationTag> |
getTags() |
java.lang.String |
getTownshipDivision()
Deprecated.
As of 1.8, replaced by
getAddress4() |
java.lang.Boolean |
hasTag(java.lang.String tagToFind)
Checks whether the Location has a particular tag.
|
Location |
hydrate(java.lang.String locationId)
Deserialize the given string into a full object
|
static java.lang.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.
|
java.lang.String |
serialize()
Turn the current object into an identifying string that can be retrieved later
|
void |
setAddress1(java.lang.String address1) |
void |
setAddress2(java.lang.String address2) |
void |
setAddress3(java.lang.String address3) |
void |
setAddress4(java.lang.String address4) |
void |
setAddress5(java.lang.String address5) |
void |
setAddress6(java.lang.String address6) |
void |
setChildLocations(java.util.Set<Location> childLocations) |
void |
setCityVillage(java.lang.String cityVillage) |
void |
setCountry(java.lang.String country) |
void |
setCountyDistrict(java.lang.String countyDistrict) |
void |
setId(java.lang.Integer id) |
void |
setLatitude(java.lang.String latitude) |
void |
setLocationId(java.lang.Integer locationId) |
void |
setLongitude(java.lang.String longitude) |
void |
setNeighborhoodCell(java.lang.String address3)
Deprecated.
As of 1.8, replaced by
setAddress3(String) |
void |
setParentLocation(Location parentLocationId) |
void |
setPostalCode(java.lang.String postalCode) |
void |
setRegion(java.lang.String address6)
Deprecated.
As of 1.8, replaced by
setAddress6(String) |
void |
setStateProvince(java.lang.String stateProvince) |
void |
setSubregion(java.lang.String address5)
Deprecated.
As of 1.8, replaced by
setAddress5(String) |
void |
setTags(java.util.Set<LocationTag> tags)
Set the tags which are attached to this Location.
|
void |
setTownshipDivision(java.lang.String address4)
Deprecated.
As of 1.8, replaced by
setAddress4(String) |
java.lang.String |
toString()
Returns a string consisting of the name of the class of which the object is an instance and
the
uuid field surrounded by [ and ] . |
addAttribute, getActiveAttributes, getActiveAttributes, getAttributes, setAttribute, setAttributes
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public static final long serialVersionUID
public static final int LOCATION_UNKNOWN
public Location()
public Location(java.lang.Integer locationId)
public java.lang.String getAddress1()
getAddress1
in interface Address
public void setAddress1(java.lang.String address1)
setAddress1
in interface Address
address1
- The address1 to set.public java.lang.String getAddress2()
getAddress2
in interface Address
public void setAddress2(java.lang.String address2)
setAddress2
in interface Address
address2
- The address2 to set.public java.lang.String getCityVillage()
getCityVillage
in interface Address
public void setCityVillage(java.lang.String cityVillage)
setCityVillage
in interface Address
cityVillage
- The cityVillage to set.public java.lang.String getCountry()
getCountry
in interface Address
public void setCountry(java.lang.String country)
setCountry
in interface Address
country
- The country to set.public java.lang.String getLatitude()
getLatitude
in interface Address
public void setLatitude(java.lang.String latitude)
setLatitude
in interface Address
latitude
- The latitude to set.public java.lang.Integer getLocationId()
public void setLocationId(java.lang.Integer locationId)
locationId
- The locationId to set.public java.lang.String getLongitude()
getLongitude
in interface Address
public void setLongitude(java.lang.String longitude)
setLongitude
in interface Address
longitude
- The longitude to set.public java.lang.String getPostalCode()
getPostalCode
in interface Address
public void setPostalCode(java.lang.String postalCode)
setPostalCode
in interface Address
postalCode
- The postalCode to set.public java.lang.String getStateProvince()
getStateProvince
in interface Address
public void setStateProvince(java.lang.String stateProvince)
setStateProvince
in interface Address
stateProvince
- The stateProvince to set.public java.lang.String toString()
BaseOpenmrsObject
uuid
field surrounded by [
and ]
. In other words,
this method returns a string equal to the value of: getClass().getName() + '[' + uuid + ']'
If the uuid
field is null
, it delegates to
Object.toString()
toString
in class BaseOpenmrsObject
Object.toString()
public java.lang.String getCountyDistrict()
getCountyDistrict
in interface Address
public void setCountyDistrict(java.lang.String countyDistrict)
setCountyDistrict
in interface Address
countyDistrict
- The countyDistrict to set.@Deprecated public java.lang.String getNeighborhoodCell()
getAddress3()
@Deprecated public void setNeighborhoodCell(java.lang.String address3)
setAddress3(String)
address3
- The neighborhoodCell to set.public java.util.List<Location> findPossibleValues(java.lang.String searchText)
Attributable
findPossibleValues
in interface Attributable<Location>
searchText
- String to search onAttributable.findPossibleValues(java.lang.String)
public java.util.List<Location> getPossibleValues()
Attributable
getPossibleValues
in interface Attributable<Location>
Attributable.getPossibleValues()
public Location hydrate(java.lang.String locationId)
Attributable
hydrate
in interface Attributable<Location>
locationId
- String to deserializeAttributable.hydrate(java.lang.String)
public java.lang.String serialize()
Attributable
serialize
in interface Attributable<Location>
Attributable.serialize()
public java.lang.String getDisplayString()
Attributable
getDisplayString
in interface Attributable<Location>
Attributable.getDisplayString()
@Deprecated public java.lang.String getRegion()
getAddress6()
@Deprecated public void setRegion(java.lang.String address6)
setAddress6(String)
address6
- the region to set@Deprecated public java.lang.String getSubregion()
getAddress5()
@Deprecated public void setSubregion(java.lang.String address5)
setAddress5(String)
address5
- the subregion to set@Deprecated public java.lang.String getTownshipDivision()
getAddress4()
@Deprecated public void setTownshipDivision(java.lang.String address4)
setAddress4(String)
address4
- the townshipDivision to setpublic Location getParentLocation()
public void setParentLocation(Location parentLocationId)
parentLocationId
- The parentLocation to set.public java.util.Set<Location> getChildLocations()
public java.util.Set<Location> getChildLocations(boolean includeRetired)
includeRetired
- specifies whether or not to include voided childLocationspublic void setChildLocations(java.util.Set<Location> childLocations)
childLocations
- The childLocations to set.public void addChildLocation(Location child)
child
- The child location to add.public static java.lang.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 java.util.Set<LocationTag> getTags()
public void setTags(java.util.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 java.lang.Boolean hasTag(java.lang.String tagToFind)
tagToFind
- the string of the tag for which to checkpublic java.lang.String getAddress3()
getAddress3
in interface Address
public void setAddress3(java.lang.String address3)
setAddress3
in interface Address
address3
- the address3 to setpublic java.lang.String getAddress4()
getAddress4
in interface Address
public void setAddress4(java.lang.String address4)
setAddress4
in interface Address
address4
- the address4 to setpublic java.lang.String getAddress6()
getAddress6
in interface Address
public void setAddress6(java.lang.String address6)
setAddress6
in interface Address
address6
- the address6 to setpublic java.lang.String getAddress5()
getAddress5
in interface Address
public void setAddress5(java.lang.String address5)
setAddress5
in interface Address
address5
- the address5 to setpublic java.lang.Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(java.lang.Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.