All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.tornaia.geoip.GeoIP Maven / Gradle / Ivy

There is a newer version: 0.1.12
Show newest version
package com.github.tornaia.geoip;

import java.net.InetAddress;
import java.util.Optional;

public interface GeoIP {

    /**
     * Returns the country code for a specific inetAddress. For example, this would be CH for the
     * 85.1.242.106, and HU for 81.182.2.4.
     *
     * @param inetAddress the inetAddress that we want to get the country code for
     * @return two letter country code for the inetAddress denoted by inetAddress
     * @see Wikipedia: ISO_3166-2
     */
    Optional getTwoLetterCountryCode(InetAddress inetAddress);

    /**
     * Returns the country code for a specific ip address. For example, this would be CH for the
     * 85.1.242.106, and HU for 81.182.2.4.
     *
     * @param ipAddress the ip address that we want to get the country code for
     * @return two letter country code for the ip address denoted by inetAddress
     * @see Wikipedia: ISO_3166-2
     */
    Optional getTwoLetterCountryCode(String ipAddress);

    /**
     * Returns the country name for a specific inetAddress. For example, this would be Switzerland
     *  for the 85.1.242.106, and Hungary for 81.182.2.4.
     *
     * @param inetAddress the inetAddress that we want to get the country name for
     * @return country name for the inetAddress denoted by inetAddress
     */
    Optional getCountryName(InetAddress inetAddress);

    /**
     * Returns the country name for a specific ip address. For example, this would be
     * Switzerland for the 85.1.242.106, and Hungary for 81.182.2.4.
     *
     * @param ipAddress the ipAddress that we want to get the country name for
     * @return country name for the inetAddress denoted by inetAddress
     */
    Optional getCountryName(String ipAddress);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy