Package org.localify.auth.dto.web
Class GeoIpDetails
java.lang.Object
org.localify.auth.dto.web.GeoIpDetails
- All Implemented Interfaces:
Serializable
Represents geographical details obtained from an IP address.
This class is embeddable and can be used in other entities.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GeoIpDetailsReturns a default set of geographical details (Ithaca, NY).static GeoIpDetailsfromCityResponse(com.maxmind.geoip2.model.CityResponse res) Creates a GeoIpDetails object from a MaxMind CityResponse.getCity()Gets the city name.Gets the country name.Gets the latitude.Gets the longitude.Gets the subdivision (e.g., state or province).Sets the city name.setCountry(String country) Sets the country name.setLatitude(Double latitude) Sets the latitude.setLongitude(Double longitude) Sets the longitude.setSubdivision(String subdivision) Sets the subdivision.
-
Constructor Details
-
GeoIpDetails
public GeoIpDetails()Default constructor.
-
-
Method Details
-
fromCityResponse
Creates a GeoIpDetails object from a MaxMind CityResponse.- Parameters:
res- The MaxMind CityResponse.- Returns:
- A new GeoIpDetails object, or null if the input is null.
-
getCity
Gets the city name.- Returns:
- The city name.
-
setCity
Sets the city name.- Parameters:
city- The city name.- Returns:
- This GeoIpDetails instance.
-
getSubdivision
Gets the subdivision (e.g., state or province).- Returns:
- The subdivision.
-
setSubdivision
Sets the subdivision.- Parameters:
subdivision- The subdivision.- Returns:
- This GeoIpDetails instance.
-
getCountry
Gets the country name.- Returns:
- The country name.
-
setCountry
Sets the country name.- Parameters:
country- The country name.- Returns:
- This GeoIpDetails instance.
-
getLatitude
Gets the latitude.- Returns:
- The latitude.
-
setLatitude
Sets the latitude.- Parameters:
latitude- The latitude.- Returns:
- This GeoIpDetails instance.
-
getLongitude
Gets the longitude.- Returns:
- The longitude.
-
setLongitude
Sets the longitude.- Parameters:
longitude- The longitude.- Returns:
- This GeoIpDetails instance.
-
defaultGeoDetails
Returns a default set of geographical details (Ithaca, NY).- Returns:
- A new GeoIpDetails object with default values.
-