Skip to content

Commit d844d70

Browse files
committed
Use LinkedHashSet instead of HashSet, and rename class to Vocabularies
Signed-off-by:Bart Hanssens <bart.hanssens@fedict.be>
1 parent 9fb1b8e commit d844d70

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

core/model/src/main/java/org/eclipse/rdf4j/model/util/VocabularyUtil.java renamed to core/model/src/main/java/org/eclipse/rdf4j/model/util/Vocabularies.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
package org.eclipse.rdf4j.model.util;
99

1010
import java.lang.reflect.Field;
11-
import java.util.HashSet;
11+
import java.util.LinkedHashSet;
1212
import java.util.Set;
1313

1414
import org.eclipse.rdf4j.model.IRI;
@@ -18,15 +18,15 @@
1818
*
1919
* @author Bart Hanssens
2020
*/
21-
public class VocabularyUtil {
21+
public class Vocabularies {
2222
/**
2323
* Get all the {@link IRI IRIs} of the classes and properties of a vocabulary.
2424
*
2525
* @param vocabulary RDF vocabulary
2626
* @return set of IRIs
2727
*/
2828
public static Set<IRI> getAllIRIs(Class vocabulary) {
29-
Set<IRI> iris = new HashSet<>();
29+
Set<IRI> iris = new LinkedHashSet<>();
3030

3131
for (Field f : vocabulary.getFields()) {
3232
if (f.getType().equals(IRI.class)) {

core/model/src/test/java/org/eclipse/rdf4j/model/util/VocabularyUtilTest.java renamed to core/model/src/test/java/org/eclipse/rdf4j/model/util/VocabulariesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* @author Bart Hanssens
2222
*/
23-
public class VocabularyUtilTest {
23+
public class VocabulariesTest {
2424

2525
@Test
2626
public void testVocabAllIRI() throws Exception {
@@ -29,7 +29,7 @@ public void testVocabAllIRI() throws Exception {
2929
DC.FORMAT, DC.IDENTIFIER, DC.LANGUAGE, DC.PUBLISHER, DC.RELATION,
3030
DC.RIGHTS, DC.SOURCE, DC.SUBJECT, DC.TITLE, DC.TYPE));
3131

32-
Set<IRI> allIRIs = VocabularyUtil.getAllIRIs(DC.class);
32+
Set<IRI> allIRIs = Vocabularies.getAllIRIs(DC.class);
3333

3434
assertEquals(dcIRIs, allIRIs);
3535
}

0 commit comments

Comments
 (0)