• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

knowledgepixels / nanodash / 18155160356

01 Oct 2025 07:42AM UTC coverage: 13.788% (-0.03%) from 13.817%
18155160356

push

github

ashleycaselli
docs: add missing or update Javadoc annotations

445 of 4084 branches covered (10.9%)

Branch coverage included in aggregate %.

1155 of 7520 relevant lines covered (15.36%)

0.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.14
src/main/java/com/knowledgepixels/nanodash/RegistryAccountInfo.java
1
package com.knowledgepixels.nanodash;
2

3
import com.github.jsonldjava.shaded.com.google.common.reflect.TypeToken;
4
import com.google.gson.Gson;
5
import com.google.gson.JsonIOException;
6
import com.google.gson.JsonSyntaxException;
7
import org.eclipse.rdf4j.model.IRI;
8
import org.eclipse.rdf4j.model.util.Values;
9

10
import java.io.IOException;
11
import java.io.InputStreamReader;
12
import java.lang.reflect.Type;
13
import java.net.URI;
14
import java.net.URISyntaxException;
15
import java.util.ArrayList;
16
import java.util.List;
17

18
/**
19
 * This class is used to access registry account lists of Nanopub Registry instances.
20
 */
21
public class RegistryAccountInfo {
3✔
22

23
    private static Gson g = new Gson();
4✔
24
    private static Type listType = new TypeToken<ArrayList<RegistryAccountInfo>>() {
7✔
25
    }.getType();
2✔
26

27
    /**
28
     * Fetches and parses a list of registry accounts from the given URL.
29
     *
30
     * @param url e.g. "<a href="https://registry.knowledgepixels.com/list.json">https://registry.knowledgepixels.com/list.json</a>"
31
     * @return List of RegistryAccountInfo objects
32
     * @throws JsonIOException     if there is a problem reading from the URL
33
     * @throws JsonSyntaxException if the JSON is not in the expected format
34
     * @throws IOException         if there is a problem with the network connection
35
     * @throws URISyntaxException  if the URL is not valid
36
     */
37
    public static List<RegistryAccountInfo> fromUrl(String url) throws JsonIOException, JsonSyntaxException, IOException, URISyntaxException {
38
        return g.fromJson(new InputStreamReader(new URI(url).toURL().openStream()), listType);
14✔
39
    }
40

41
    private String agent;
42
    private String pubkey;
43
    private String status;
44
    private int depth;
45
    private int pathCount;
46
    private long quota;
47
    private double ratio;
48

49
    /**
50
     * Returns the Type object representing a list of RegistryAccountInfo objects.
51
     *
52
     * @return Type object
53
     */
54
    public static Type getListType() {
55
        return listType;
×
56
    }
57

58
    /**
59
     * Returns the agent URI as a string.
60
     *
61
     * @return Agent URI string
62
     */
63
    public String getAgent() {
64
        return agent;
3✔
65
    }
66

67
    /**
68
     * Returns the agent URI as an IRI object.
69
     *
70
     * @return Agent IRI
71
     */
72
    public IRI getAgentIri() {
73
        return Values.iri(agent);
4✔
74
    }
75

76
    /**
77
     * Returns the public key associated with the account.
78
     *
79
     * @return Public key string
80
     */
81
    public String getPubkey() {
82
        return pubkey;
3✔
83
    }
84

85
    /**
86
     * Returns the status of the account.
87
     *
88
     * @return Status string
89
     */
90
    public String getStatus() {
91
        return status;
×
92
    }
93

94
    /**
95
     * Returns the depth of the account.
96
     *
97
     * @return Depth integer
98
     */
99
    public int getDepth() {
100
        return depth;
×
101
    }
102

103
    /**
104
     * Returns the path count of the account.
105
     *
106
     * @return Path count integer
107
     */
108
    public int getPathCount() {
109
        return pathCount;
×
110
    }
111

112
    /**
113
     * Returns the quota of the account.
114
     *
115
     * @return Quota long
116
     */
117
    public long getQuota() {
118
        return quota;
×
119
    }
120

121
    /**
122
     * Returns the ratio of the account.
123
     *
124
     * @return Ratio double
125
     */
126
    public double getRatio() {
127
        return ratio;
×
128
    }
129

130
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc