Skip to content

Commit cfbed64

Browse files
committed
Add docs for types
1 parent 8400fcb commit cfbed64

File tree

8 files changed

+33
-9
lines changed

8 files changed

+33
-9
lines changed

checkstyle.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -333,20 +333,13 @@
333333
<property name="allowedAnnotations" value="Override, Test"/>
334334
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF"/>
335335
</module>
336-
<!-- <module name="MissingJavadocMethod">
337-
<property name="scope" value="public"/>
338-
<property name="minLineCount" value="2"/>
339-
<property name="allowedAnnotations" value="Override, Test"/>
340-
<property name="tokens" value="METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF,
341-
COMPACT_CTOR_DEF"/>
342-
</module>
343336
<module name="MissingJavadocType">
344337
<property name="scope" value="protected"/>
345338
<property name="tokens"
346339
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF,
347340
RECORD_DEF, ANNOTATION_DEF"/>
348341
<property name="excludeScope" value="nothing"/>
349-
</module> -->
342+
</module>
350343
<module name="MethodName">
351344
<property name="format" value="^[a-z][a-z0-9]\w*$"/>
352345
<message key="name.invalidPattern"

src/main/java/com/maxmind/db/CacheKey.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.maxmind.db;
22

3+
/**
4+
* CacheKey is used as a key in the node cache. It contains the offset of the
5+
* node in the database file, the class of the data at that node, and the type
6+
* of the data at that node.
7+
*/
38
public final class CacheKey<T> {
49
private final int offset;
510
private final Class<T> cls;

src/main/java/com/maxmind/db/DecodedValue.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package com.maxmind.db;
22

3+
/**
4+
* DecodedValue is a wrapper for the decoded value and the number of bytes used
5+
* to decode it.
6+
*/
37
public final class DecodedValue {
48
final Object value;
59

src/main/java/com/maxmind/db/InvalidNetworkException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
import java.net.InetAddress;
44

5+
/**
6+
* This is a custom exception that is thrown when the user attempts to use an
7+
* IPv6 address in an IPv4-only database.
8+
*/
59
public class InvalidNetworkException extends Exception {
610
public InvalidNetworkException(InetAddress ip) {
711
super("you attempted to use an IPv6 network in an IPv4-only database: " + ip.toString());

src/main/java/com/maxmind/db/MaxMindDbConstructor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import java.lang.annotation.Retention;
44
import java.lang.annotation.RetentionPolicy;
55

6+
/**
7+
* MaxMindDbConstructor is an annotation that can be used to mark a constructor
8+
* that should be used to create an instance of a class when decoding a MaxMind
9+
* DB file.
10+
*/
611
@Retention(RetentionPolicy.RUNTIME)
712
public @interface MaxMindDbConstructor {
813
}

src/main/java/com/maxmind/db/MaxMindDbParameter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import java.lang.annotation.Retention;
44
import java.lang.annotation.RetentionPolicy;
55

6+
/**
7+
* Interface for a MaxMind DB parameter. This is used to mark a parameter that
8+
* should be used to create an instance of a class when decoding a MaxMind DB
9+
* file.
10+
*/
611
@Retention(RetentionPolicy.RUNTIME)
712
public @interface MaxMindDbParameter {
813
String name();

src/main/java/com/maxmind/db/Metadata.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
import java.util.List;
66
import java.util.Map;
77

8+
/**
9+
* Metadata holds data associated with the database itself.
10+
*/
811
public final class Metadata {
912
private final int binaryFormatMajorVersion;
1013
private final int binaryFormatMinorVersion;

src/main/java/com/maxmind/db/NodeCache.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
import java.io.IOException;
44

5+
/**
6+
* NodeCache is an interface for a cache that stores decoded nodes.
7+
*/
58
public interface NodeCache {
6-
9+
/**
10+
* A loader is used to load a value for a key that is not in the cache.
11+
*/
712
interface Loader {
813
DecodedValue load(CacheKey key) throws IOException;
914
}

0 commit comments

Comments
 (0)