Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #33 from nguillaumin/access-country-names-and-codes
Browse files Browse the repository at this point in the history
Added accessors to the list of all country names and codes
  • Loading branch information
oschwald committed Feb 8, 2016
2 parents d8f6a94 + 6204c68 commit 8f72fa2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/com/maxmind/geoip/LookupService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
import java.nio.charset.CharacterCodingException;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.util.Arrays;
import java.util.List;

/**
* Provides a lookup service for information based on an IP address. The
Expand Down Expand Up @@ -402,6 +404,20 @@ public synchronized void close() {
}
}

/**
* @return The list of all known country names
*/
public List<String> getAllCountryNames() {
return Arrays.asList(Arrays.copyOf(countryName, countryName.length));
}

/**
* @return The list of all known country codes
*/
public List<String> getAllCountryCodes() {
return Arrays.asList(Arrays.copyOf(countryCode, countryCode.length));
}

/**
* Returns the country the IP address is in.
*
Expand Down

0 comments on commit 8f72fa2

Please sign in to comment.