java.lang.Object
com.maxmind.db.Metadata
Metadata for MaxMind database files. Contains information about database format, version, build epoch, type, languages, and various structural information about the database.
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionintGets the major version of the database's binary format.intGets the minor version of the database's binary format.Gets the date the database was built.Gets the structure of the data records associated with an IP address.Gets the database description in each supported language.intGets the IP version the database holds address data for.Gets the languages the database carries localized names in.(package private) intGets the size in bytes of one search tree node.(package private) intGets the number of nodes in the search tree.(package private) intGets the number of bits in one search tree record.(package private) intGets the total size in bytes of the search tree.toString()Return a description of the database metadata, for diagnostics.
Constructor Details
Metadata
Metadata(Map metadata) Create Metadata from decoded map- Parameters:
metadata- the decoded metadata map keyed by field name, for example "build_epoch"
Method Details
getBinaryFormatMajorVersion
public int getBinaryFormatMajorVersion()Gets the major version of the database's binary format.- Returns:
- the major version number for the database's binary format.
getBinaryFormatMinorVersion
public int getBinaryFormatMinorVersion()Gets the minor version of the database's binary format.- Returns:
- the minor version number for the database's binary format.
getBuildDate
Gets the date the database was built.- Returns:
- the date of the database build.
getDatabaseType
Gets the structure of the data records associated with an IP address. The actual definition of these structures is left up to the database creator.- Returns:
- a string that indicates the structure of each data record
getDescription
getIpVersion
public int getIpVersion()Gets the IP version the database holds address data for.- Returns:
- whether the database contains IPv4 or IPv6 address data. The only possible values are 4 and 6.
getLanguages
getNodeByteSize
int getNodeByteSize()Gets the size in bytes of one search tree node.- Returns:
- the size in bytes of a single search tree node
getNodeCount
int getNodeCount()Gets the number of nodes in the search tree.- Returns:
- the number of nodes in the search tree.
getRecordSize
int getRecordSize()Gets the number of bits in one search tree record. Note that each node consists of two records.- Returns:
- the number of bits in a record in the search tree. Note that each node consists of two records.
getSearchTreeSize
int getSearchTreeSize()Gets the total size in bytes of the search tree.- Returns:
- the size in bytes of the whole search tree
toString