UUID cubaAreasVocabularyUuid = UUID.fromString("c81e3c7b-3c01-47d1-87cf-388de4b1908c");
String label = "Cuba Areas";
String abbrev = null;
- cubaAreasVocabualary = OrderedTermVocabulary.NewInstance(TermType.NamedArea, label, label, abbrev, null);
+ cubaAreasVocabualary = OrderedTermVocabulary.NewOrderedInstance(TermType.NamedArea, NamedArea.class, label, label, abbrev, null);
cubaAreasVocabualary.setUuid(cubaAreasVocabularyUuid);
//Cuba
return new OrderedTermVocabulary(type);
}
-
/**
- * @param type the {@link TermType term type}, must be the same as for all included terms
- * @param description the description of this vocabulary
- * @param label
- * @param labelAbbrev
- * @param termSourceUri
- * @return
- * @throws NullPointerException if type is <code>null</code>
- * @deprecated use {@link #NewOrderedInstance(TermType, Class, String, String, String, URI)} instead
- */
- @Deprecated
- public static OrderedTermVocabulary NewInstance(TermType type, String description, String label, String labelAbbrev, URI termSourceUri, Language lang){
- return new OrderedTermVocabulary(type, description, label, labelAbbrev, termSourceUri, lang);
- }
-
+ * @param type the {@link TermType term type}, must be the same as for all included terms
+ * @param class the parameter is only used for correct generics handling
+ * @param description the description of this vocabulary
+ * @param label
+ * @param labelAbbrev
+ * @param termSourceUri
+ * @return
+ * @throws NullPointerException if type is <code>null</code>
+ */
public static <T extends OrderedTermBase<T>> OrderedTermVocabulary<T> NewOrderedInstance(TermType type, Class<T> clazz, String description, String label, String labelAbbrev, URI termSourceUri){
- return new OrderedTermVocabulary<T>(type, description, label, labelAbbrev, termSourceUri);
+ return new OrderedTermVocabulary<T>(type, description, label, labelAbbrev, termSourceUri, null);
}
-
//************************ CONSTRUCTOR *****************************************************/
//for hibernate use only
super();
}
- /**
- * @param term
- * @param label
- * @param termSourceUri
- */
protected OrderedTermVocabulary(TermType type) {
super(type);
}
-
- /**
- * @param term
- * @param label
- * @param termSourceUri
- */
- protected OrderedTermVocabulary(TermType type, String term, String label, String labelAbbrev, URI termSourceUri) {
- super(type, term, label, labelAbbrev, termSourceUri);
+ protected OrderedTermVocabulary(TermType type, String term, String label, String labelAbbrev, URI termSourceUri, Language language) {
+ super(type, term, label, labelAbbrev, termSourceUri, language);
}
- /**
- * @param term
- * @param label
- * @param termSourceUri
- */
- protected OrderedTermVocabulary(TermType type, String term, String label, String labelAbbrev, URI termSourceUri, Language lang) {
- super(type, term, label, labelAbbrev, termSourceUri);
- }
-
//************************* METHODS **************************************/
protected TermCollection(TermType type){
super(type);
}
-
-
protected TermCollection(TermType type, String term, String label, String labelAbbrev, Language lang) {
super(type, term, label, labelAbbrev, lang);
public static TermVocabulary NewInstance(TermType type){
return new TermVocabulary(type);
}
-
-
public static <T extends DefinedTermBase<T>> TermVocabulary<T> NewInstance(TermType type, Class<T> clazz){
return new TermVocabulary<T>(type);
*/
@Deprecated
public static TermVocabulary NewInstance(TermType type, String description, String label, String abbrev, URI termSourceUri){
- return new TermVocabulary(type, description, label, abbrev, termSourceUri);
+ return new TermVocabulary(type, description, label, abbrev, termSourceUri, null);
}
- public static <T extends DefinedTermBase<T>> TermVocabulary<T> NewInstance(TermType type, Class<T> clazz, String description, String label, String abbrev, URI termSourceUri){
- return new TermVocabulary<T>(type, description, label, abbrev, termSourceUri);
+ public static <T extends DefinedTermBase<T>> TermVocabulary<T> NewInstance(TermType type, Class<T> clazz,
+ String description, String label, String abbrev, URI termSourceUri){
+ return new TermVocabulary<T>(type, description, label, abbrev, termSourceUri, null);
}
-
- public static <T extends DefinedTermBase<T>> TermVocabulary<T> NewInstance(TermType type, Class<T> clazz, String description, String label, String abbrev, URI termSourceUri, Language lang){
- return new TermVocabulary<T>(type, description, label, abbrev, termSourceUri, lang);
+
+ public static <T extends DefinedTermBase<T>> TermVocabulary<T> NewInstance(TermType type, Class<T> clazz,
+ String description, String label, String abbrev, URI termSourceUri, Language language){
+ return new TermVocabulary<T>(type, description, label, abbrev, termSourceUri, language);
}
protected TermVocabulary(TermType type) {
super(type);
}
-
- protected TermVocabulary(TermType type, String term, String label, String labelAbbrev, URI termSourceUri) {
- super(type, term, label, labelAbbrev);
- setTermSourceUri(termSourceUri);
- }
- protected TermVocabulary(TermType type, String term, String label, String labelAbbrev, URI termSourceUri, Language lang) {
- super(type, term, label, labelAbbrev, lang);
+ protected TermVocabulary(TermType type, String term, String label, String labelAbbrev, URI termSourceUri, Language language) {
+ super(type, term, label, labelAbbrev, language);
setTermSourceUri(termSourceUri);
}
-
protected Set<T> newTermSet(){
return new HashSet<>();
}
@Test
public final void testOrderedTermVocabularyStringStringString() {
- oVoc2 = new OrderedTermVocabulary<>(TermType.Unknown, "term", "label", null, URI.create("http://term.Source.Uri"));
+ oVoc2 = new OrderedTermVocabulary<>(TermType.Unknown, "term", "label", null, URI.create("http://term.Source.Uri"), null);
assertEquals("label", oVoc2.getLabel());
}
@Test
public final void testTermVocabularyStringStringString() {
- voc2 = new TermVocabulary<>(TermType.Unknown, "term", "label", null, URI.create("http://term.Source.Uri"));
+ voc2 = new TermVocabulary<>(TermType.Unknown, "term", "label", null, URI.create("http://term.Source.Uri"), null);
assertEquals("label", voc2.getLabel());
}
@Test
public final void testGetTermSourceUri() {
assertEquals(null, voc1.getTermSourceUri());
- voc2 = new TermVocabulary<>(TermType.Unknown,"term", "label", null, URI.create("http://term.Source.Uri"));
+ voc2 = new TermVocabulary<>(TermType.Unknown,"term", "label", null, URI.create("http://term.Source.Uri"), null);
assertEquals("http://term.Source.Uri", voc2.getTermSourceUri().toString());
}