public final class Location
extends SlingAdaptable
LocationManager
to access location objects.Modifier and Type | Field and Description |
---|---|
static String |
HOURS |
static String |
LATITUDE |
static String |
LONGITUDE |
static String |
PHONE |
Constructor and Description |
---|
Location(Resource resource)
Creates a location object.
|
Modifier and Type | Method and Description |
---|---|
<AdapterType> |
adaptTo(Class<AdapterType> type) |
boolean |
equals(Object obj) |
Coordinates |
getCoordinates()
Returns coordinates for this location if latitude and longitude are both available.
|
String |
getDescription()
Return the description of this location as entered by the user.
|
String |
getFullAddress()
The full string representation of a location using the default set of fields
* @return full address string
|
String |
getFullAddress(String[] fields)
The full string representation of a location using the provided array of property names.
|
String[] |
getHours()
Returns the location hours, or null, if no hours property exists.
|
String |
getPath()
Returns the location path in the repository.
|
String |
getPhone()
Returns the location phone number.
|
String |
getTitle()
Returns the title of this location as entered by the user.
|
int |
hashCode() |
void |
setCoordinates(Coordinates coord)
Sets the location coordinate properties.
|
void |
setHours(String[] hours)
Sets the location hours.
|
void |
setPhone(String phone)
Sets the location phone number.
|
public static final String LATITUDE
public static final String LONGITUDE
public static final String PHONE
public static final String HOURS
public Location(Resource resource)
resource
- The resource representing a location.IllegalArgumentException
- when Resource is null
public String getPath()
public String getTitle()
null
if not defined.public String getDescription()
null
if not defined.public void setCoordinates(Coordinates coord) throws AddressException
coord
- The new location properties.AddressException
- if persisting the coordinates fails.public Coordinates getCoordinates()
null
if not definedpublic String getPhone()
public void setPhone(String phone) throws AddressException
AddressException
public String[] getHours()
public void setHours(String[] hours) throws AddressException
AddressException
public String getFullAddress()
public String getFullAddress(String[] fields)
fields
- Property names to usepublic boolean equals(Object obj)
public int hashCode()
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type)
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"