Package net.solarnetwork.central.domain
Class SolarLocation
java.lang.Object
net.solarnetwork.central.domain.BaseIdentity
net.solarnetwork.central.dao.BaseEntity
net.solarnetwork.central.domain.SolarLocation
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<Long>,EntityMatch,Filter,FilterMatch<Long>,Location,LocationMatch,net.solarnetwork.dao.Entity<Long>,net.solarnetwork.domain.Identity<Long>,net.solarnetwork.domain.Location
public class SolarLocation
extends BaseEntity
implements Cloneable, Serializable, Location, LocationMatch
A location entity.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SolarLocation(Location loc) Copy constructor forLocationobjects. -
Method Summary
Modifier and TypeMethodDescriptionGet the ISO 3166-1 alpha-2 character country code.Get the elevation, in meters.Get a mapping of filter keys and associated filter values.Get the decimal latitude.Get the locality (city, town, etc.).Get the decimal longitude.getName()A generalized name, can be used for "virtual" locations.Get a country-specific postal code.A country-specific regional identifier.Get a country-specific state or province identifier.Get the street address.static SolarLocationReturn a new SolarLocation with normalized values from another Location.voidChange values that are non-null but empty to null.voidsetCountry(String country) voidsetEl(BigDecimal elevation) Set the elevation.voidsetElevation(BigDecimal elevation) voidsetLat(BigDecimal latitude) Set the latitude.voidsetLatitude(BigDecimal latitude) voidsetLocality(String locality) voidsetLon(BigDecimal longitude) Set the longitude.voidsetLongitude(BigDecimal longitude) voidvoidsetPostalCode(String postalCode) voidvoidsetStateOrProvince(String stateOrProvince) voidvoidsetTimeZoneId(String timeZoneId) voidSet the time zone ID.toString()Methods inherited from class net.solarnetwork.central.dao.BaseEntity
getCreated, setCreatedMethods inherited from class net.solarnetwork.central.domain.BaseIdentity
clone, compareTo, equals, getId, hashCode, setIdMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface net.solarnetwork.domain.Identity
getId, hasIdMethods inherited from interface net.solarnetwork.domain.Location
hasLocationCriteria
-
Constructor Details
-
SolarLocation
public SolarLocation()Default constructor. -
SolarLocation
Copy constructor forLocationobjects.- Parameters:
loc- the location to copy
-
-
Method Details
-
removeEmptyValues
public void removeEmptyValues()Change values that are non-null but empty to null.This method is helpful for web form submission, to remove filter values that are empty and would otherwise try to match on empty string values.
-
normalizedLocation
Return a new SolarLocation with normalized values from another Location.- Parameters:
loc- the location to normalize- Returns:
- the normalized location
- Since:
- 1.3
-
getFilter
Description copied from interface:FilterGet a mapping of filter keys and associated filter values. -
toString
-
getName
Description copied from interface:LocationMatchA generalized name, can be used for "virtual" locations.- Specified by:
getNamein interfacenet.solarnetwork.domain.Location- Specified by:
getNamein interfaceLocationMatch- Returns:
- the location name
-
setName
-
getCountry
Description copied from interface:LocationMatchGet the ISO 3166-1 alpha-2 character country code.- Specified by:
getCountryin interfacenet.solarnetwork.domain.Location- Specified by:
getCountryin interfaceLocationMatch- Returns:
- 2-character country code
-
setCountry
-
getRegion
Description copied from interface:LocationMatchA country-specific regional identifier.- Specified by:
getRegionin interfacenet.solarnetwork.domain.Location- Specified by:
getRegionin interfaceLocationMatch- Returns:
- region identifier
-
setRegion
-
getStateOrProvince
Description copied from interface:LocationMatchGet a country-specific state or province identifier.- Specified by:
getStateOrProvincein interfacenet.solarnetwork.domain.Location- Specified by:
getStateOrProvincein interfaceLocationMatch- Returns:
- state or province identifier
-
setStateOrProvince
-
getLocality
Description copied from interface:LocationMatchGet the locality (city, town, etc.).- Specified by:
getLocalityin interfacenet.solarnetwork.domain.Location- Specified by:
getLocalityin interfaceLocationMatch- Returns:
- locality
-
setLocality
-
getPostalCode
Description copied from interface:LocationMatchGet a country-specific postal code.- Specified by:
getPostalCodein interfacenet.solarnetwork.domain.Location- Specified by:
getPostalCodein interfaceLocationMatch- Returns:
- postal code
-
setPostalCode
-
getStreet
Description copied from interface:LocationMatchGet the street address.- Specified by:
getStreetin interfacenet.solarnetwork.domain.Location- Specified by:
getStreetin interfaceLocationMatch- Returns:
- street
-
setStreet
-
getLatitude
Description copied from interface:LocationMatchGet the decimal latitude.- Specified by:
getLatitudein interfacenet.solarnetwork.domain.Location- Specified by:
getLatitudein interfaceLocationMatch- Returns:
- latitude
-
setLatitude
-
setLat
Set the latitude.This method is an alias for
setLatitude(BigDecimal)and is provided for compatibility with the JSON serialized form ofLocation.- Parameters:
latitude- the latitude to set- Since:
- 2.1
-
getLongitude
Description copied from interface:LocationMatchGet the decimal longitude.- Specified by:
getLongitudein interfacenet.solarnetwork.domain.Location- Specified by:
getLongitudein interfaceLocationMatch- Returns:
- longitude
-
setLongitude
-
setLon
Set the longitude.This method is an alias for
setLongitude(BigDecimal)and is provided for compatibility with the JSON serialized form ofLocation.- Parameters:
longitude- the longitude to set- Since:
- 2.1
-
getTimeZoneId
- Specified by:
getTimeZoneIdin interfacenet.solarnetwork.domain.Location
-
setTimeZoneId
-
setZone
Set the time zone ID.This method is an alias for
setTimeZoneId(String)and is provided for compatibility with the JSON serialized form ofLocation.- Parameters:
timeZoneId- the zone ID to set- Since:
- 2.1
-
getElevation
Description copied from interface:LocationMatchGet the elevation, in meters.- Specified by:
getElevationin interfacenet.solarnetwork.domain.Location- Specified by:
getElevationin interfaceLocationMatch- Returns:
- the elevation
-
setElevation
-
setEl
Set the elevation.This method is an alias for
setElevation(BigDecimal)and is provided for compatibility with the JSON serialized form ofLocation.- Parameters:
elevation- the elevation to set- Since:
- 2.1
-