Closed twalmsley closed 8 months ago
It is very common to need a single value from a possible Set of values obtained using this method in Top.java:
Set
Top.java
Set<Object> value(Object predicateId);
So the client code ends up with code similar to this in many places, which looks ugly and is hard to read:
String s = (String) entity.value(HQDM.ENTITY_NAME).iterator().next();
I suggest replacing it with two methods like this:
<T> T oneValue(IRI predicate) {...} <T> Set<T> values(IRI predicate) {...}
Using method names different from value will force clients to choose the correct new method and clear up the code clutter.
value
It is very common to need a single value from a possible
Set
of values obtained using this method inTop.java
:So the client code ends up with code similar to this in many places, which looks ugly and is hard to read:
I suggest replacing it with two methods like this:
Using method names different from
value
will force clients to choose the correct new method and clear up the code clutter.