java.lang.Object
com.maxmind.db.Metadata

public final class Metadataextends Object
Metadata for MaxMind database files. Contains information about database format, version, build epoch, type, languages, and various structural information about the database.
  • 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

      public Date getBuildDate()
      Gets the date the database was built.
      Returns:
      the date of the database build.
    • getDatabaseType

      public String 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

      public Map<String,String> getDescription()
      Gets the database description in each supported language.
      Returns:
      map from language code to description in that language.
    • 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

      public List<String> getLanguages()
      Gets the languages the database carries localized names in.
      Returns:
      list of languages supported by the database.
    • 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

      public String toString()
      Return a description of the database metadata, for diagnostics.
      Overrides:
      toString in class Object