Class GeoIpDetails

java.lang.Object
org.localify.auth.dto.web.GeoIpDetails
All Implemented Interfaces:
Serializable

@Embeddable public class GeoIpDetails extends Object implements Serializable
Represents geographical details obtained from an IP address. This class is embeddable and can be used in other entities.
See Also:
  • Constructor Details

    • GeoIpDetails

      public GeoIpDetails()
      Default constructor.
  • Method Details

    • fromCityResponse

      public static GeoIpDetails fromCityResponse(com.maxmind.geoip2.model.CityResponse res)
      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

      public String getCity()
      Gets the city name.
      Returns:
      The city name.
    • setCity

      public GeoIpDetails setCity(String city)
      Sets the city name.
      Parameters:
      city - The city name.
      Returns:
      This GeoIpDetails instance.
    • getSubdivision

      public String getSubdivision()
      Gets the subdivision (e.g., state or province).
      Returns:
      The subdivision.
    • setSubdivision

      public GeoIpDetails setSubdivision(String subdivision)
      Sets the subdivision.
      Parameters:
      subdivision - The subdivision.
      Returns:
      This GeoIpDetails instance.
    • getCountry

      public String getCountry()
      Gets the country name.
      Returns:
      The country name.
    • setCountry

      public GeoIpDetails setCountry(String country)
      Sets the country name.
      Parameters:
      country - The country name.
      Returns:
      This GeoIpDetails instance.
    • getLatitude

      public Double getLatitude()
      Gets the latitude.
      Returns:
      The latitude.
    • setLatitude

      public GeoIpDetails setLatitude(Double latitude)
      Sets the latitude.
      Parameters:
      latitude - The latitude.
      Returns:
      This GeoIpDetails instance.
    • getLongitude

      public Double getLongitude()
      Gets the longitude.
      Returns:
      The longitude.
    • setLongitude

      public GeoIpDetails setLongitude(Double longitude)
      Sets the longitude.
      Parameters:
      longitude - The longitude.
      Returns:
      This GeoIpDetails instance.
    • defaultGeoDetails

      public static GeoIpDetails defaultGeoDetails()
      Returns a default set of geographical details (Ithaca, NY).
      Returns:
      A new GeoIpDetails object with default values.