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

knowledgepixels / nanodash / 21519787438

30 Jan 2026 02:47PM UTC coverage: 14.273% (-0.7%) from 15.008%
21519787438

push

github

tkuhn
feat: Support part-pages for user profiles

553 of 5132 branches covered (10.78%)

Branch coverage included in aggregate %.

1515 of 9357 relevant lines covered (16.19%)

2.81 hits per line

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

0.0
src/main/java/com/knowledgepixels/nanodash/IndividualAgent.java
1
package com.knowledgepixels.nanodash;
2

3
import java.util.HashMap;
4
import java.util.Map;
5
import java.util.Set;
6

7
import org.eclipse.rdf4j.model.IRI;
8

9
// TODO Merge this class with User or otherwise make them aligned.
10
public class IndividualAgent extends ProfiledResource {
11

12
    private static Map<String,IndividualAgent> instanceMap = new HashMap<>();
×
13

14
    public static IndividualAgent get(String id) {
15
        if (!instanceMap.containsKey(id)) {
×
16
            instanceMap.put(id, new IndividualAgent(id));
×
17
        }
18
        return instanceMap.get(id);
×
19
    }
20

21
    private IndividualAgent(String id) {
22
        super(id);
×
23
    }
×
24

25
    public boolean isCurrentUser() {
26
        IRI userIri = NanodashSession.get().getUserIri();
×
27
        if (userIri == null) return false;
×
28
        return getId().equals(userIri.stringValue());
×
29
    }
30

31
    @Override
32
    public String getLabel() {
33
        try {
34
            return User.getUserData().getShortDisplayName(Utils.vf.createIRI(getId()));
×
35
        } catch (Exception ex) {
×
36
        }
37
        return getId();
×
38
    }
39

40
    /**
41
     * Returns whether any view display of this user applies to the given element.
42
     */
43
    public boolean appliesTo(String elementId, Set<IRI> classes) {
44
        triggerDataUpdate();
×
45
        for (ViewDisplay v : getViewDisplays()) {
×
46
            if (v.appliesTo(elementId, classes)) return true;
×
47
        }
×
48
        return false;
×
49
    }
50

51
}
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