55import java .util .List ;
66import java .util .Map ;
77
8+ /**
9+ * {@code Metadata} holds data associated with the database itself.
10+ */
811public final class Metadata {
912 private final int binaryFormatMajorVersion ;
1013 private final int binaryFormatMinorVersion ;
@@ -27,27 +30,40 @@ public final class Metadata {
2730
2831 private final int searchTreeSize ;
2932
33+ /**
34+ * Constructs a {@code Metadata} object.
35+ *
36+ * @param binaryFormatMajorVersion The major version number for the database's
37+ * binary format.
38+ * @param binaryFormatMinorVersion The minor version number for the database's
39+ * binary format.
40+ * @param buildEpoch The date of the database build.
41+ * @param databaseType A string that indicates the structure of each
42+ * data record associated with an IP address.
43+ * The actual definition of these structures is
44+ * left up to the database creator.
45+ * @param languages List of languages supported by the database.
46+ * @param description Map from language code to description in that
47+ * language.
48+ * @param ipVersion Whether the database contains IPv4 or IPv6
49+ * address data. The only possible values are 4
50+ * and 6.
51+ * @param nodeCount The number of nodes in the search tree.
52+ * @param recordSize The number of bits in a record in the search
53+ * tree. Note that each node consists of two
54+ * records.
55+ */
3056 @ MaxMindDbConstructor
3157 public Metadata (
32- @ MaxMindDbParameter (name = "binary_format_major_version" )
33- int binaryFormatMajorVersion ,
34- @ MaxMindDbParameter (name = "binary_format_minor_version" )
35- int binaryFormatMinorVersion ,
36- @ MaxMindDbParameter (name = "build_epoch" )
37- BigInteger buildEpoch ,
38- @ MaxMindDbParameter (name = "database_type" )
39- String databaseType ,
40- @ MaxMindDbParameter (name = "languages" )
41- List <String > languages ,
42- @ MaxMindDbParameter (name = "description" )
43- Map <String , String > description ,
44- @ MaxMindDbParameter (name = "ip_version" )
45- int ipVersion ,
46- @ MaxMindDbParameter (name = "node_count" )
47- long nodeCount ,
48- @ MaxMindDbParameter (name = "record_size" )
49- int recordSize
50- ) {
58+ @ MaxMindDbParameter (name = "binary_format_major_version" ) int binaryFormatMajorVersion ,
59+ @ MaxMindDbParameter (name = "binary_format_minor_version" ) int binaryFormatMinorVersion ,
60+ @ MaxMindDbParameter (name = "build_epoch" ) BigInteger buildEpoch ,
61+ @ MaxMindDbParameter (name = "database_type" ) String databaseType ,
62+ @ MaxMindDbParameter (name = "languages" ) List <String > languages ,
63+ @ MaxMindDbParameter (name = "description" ) Map <String , String > description ,
64+ @ MaxMindDbParameter (name = "ip_version" ) int ipVersion ,
65+ @ MaxMindDbParameter (name = "node_count" ) long nodeCount ,
66+ @ MaxMindDbParameter (name = "record_size" ) int recordSize ) {
5167 this .binaryFormatMajorVersion = binaryFormatMajorVersion ;
5268 this .binaryFormatMinorVersion = binaryFormatMinorVersion ;
5369 this .buildEpoch = buildEpoch ;
@@ -85,8 +101,8 @@ public Date getBuildDate() {
85101
86102 /**
87103 * @return a string that indicates the structure of each data record
88- * associated with an IP address. The actual definition of these
89- * structures is left up to the database creator.
104+ * associated with an IP address. The actual definition of these
105+ * structures is left up to the database creator.
90106 */
91107 public String getDatabaseType () {
92108 return this .databaseType ;
@@ -101,7 +117,7 @@ public Map<String, String> getDescription() {
101117
102118 /**
103119 * @return whether the database contains IPv4 or IPv6 address data. The only
104- * possible values are 4 and 6.
120+ * possible values are 4 and 6.
105121 */
106122 public int getIpVersion () {
107123 return this .ipVersion ;
@@ -130,7 +146,7 @@ int getNodeCount() {
130146
131147 /**
132148 * @return the number of bits in a record in the search tree. Note that each
133- * node consists of two records.
149+ * node consists of two records.
134150 */
135151 int getRecordSize () {
136152 return this .recordSize ;
@@ -151,11 +167,11 @@ int getSearchTreeSize() {
151167 @ Override
152168 public String toString () {
153169 return "Metadata [binaryFormatMajorVersion="
154- + this .binaryFormatMajorVersion + ", binaryFormatMinorVersion="
155- + this .binaryFormatMinorVersion + ", buildEpoch="
156- + this .buildEpoch + ", databaseType=" + this .databaseType
157- + ", description=" + this .description + ", ipVersion="
158- + this .ipVersion + ", nodeCount=" + this .nodeCount
159- + ", recordSize=" + this .recordSize + "]" ;
170+ + this .binaryFormatMajorVersion + ", binaryFormatMinorVersion="
171+ + this .binaryFormatMinorVersion + ", buildEpoch="
172+ + this .buildEpoch + ", databaseType=" + this .databaseType
173+ + ", description=" + this .description + ", ipVersion="
174+ + this .ipVersion + ", nodeCount=" + this .nodeCount
175+ + ", recordSize=" + this .recordSize + "]" ;
160176 }
161177}
0 commit comments