Project

General

Profile

Revision 53c7a226

ID53c7a226ed07d04c5ae743bb56cb65b112c0f340
Parent 2617ad64
Child a08b6fbc

Added by Andreas Müller 12 months ago

ref #6794 rename other TermTree.NewInstance methods and set old version to deprecated

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/term/TermTree.java
103 103
	 */
104 104
	@Deprecated
105 105
    public static TermTree<Feature> NewInstance(){
106
		return new TermTree<>(TermType.Feature);
106
		return NewFeatureInstance();
107 107
	}
108 108

  
109 109
    public static TermTree<Feature> NewFeatureInstance(){
110 110
        return new TermTree<>(TermType.Feature);
111 111
    }
112 112

  
113

  
113 114
	/**
114
	 * Creates a new feature tree instance with an empty {@link #getRoot() root node}
115
	 * and assigns to the new feature tree the given
116
	 * UUID (universally unique identifier).
117
	 *
118
	 * @param	uuid	the universally unique identifier
119
	 * @see 			#NewInstance()
120
	 * @see 			#NewInstance(List)
115
	 * @deprecated since 5.9, use {@link #NewFeatureInstance(UUID)} instead
121 116
	 */
122
	public static <T extends DefinedTermBase<T>> TermTree<T> NewInstance(UUID uuid){
123
		TermTree<T> result =  new TermTree<>(TermType.Feature);
124
		result.setUuid(uuid);
125
		return result;
117
	@Deprecated
118
    public static TermTree<? extends Feature> NewInstance(UUID uuid){
119
		return NewFeatureInstance(uuid);
126 120
	}
121
	/**
122
     * Creates a new feature tree instance with an empty {@link #getRoot() root node}
123
     * and assigns to the new feature tree the given
124
     * UUID (universally unique identifier).
125
     *
126
     * @param   uuid    the universally unique identifier
127
     * @see             #NewInstance()
128
     * @see             #NewInstance(List)
129
     */
130
    public static <T extends DefinedTermBase<T>> TermTree<T> NewFeatureInstance(UUID uuid){
131
        TermTree<T> result =  new TermTree<>(TermType.Feature);
132
        result.setUuid(uuid);
133
        return result;
134
    }
135

  
127 136

  
137
    /**
138
     * @deprecated sinde 5.9 use {@link #NewFeatureInstance(List)} instead
139
     */
140
    @Deprecated
141
    public static TermTree<Feature> NewInstance(List<Feature> featureList){
142
        return NewFeatureInstance(featureList);
143
    }
128 144
	/**
129 145
	 * Creates a new feature tree instance with a {@link #getRoot() root node}
130 146
	 * the children of which are the feature nodes build on the base of the
......
136 152
	 * @see 				#NewInstance()
137 153
	 * @see 				#NewInstance(UUID)
138 154
	 */
139
	public static TermTree<Feature> NewInstance(List<Feature> featureList){
155
	public static TermTree<Feature> NewFeatureInstance(List<Feature> featureList){
140 156
		TermTree<Feature> result =  new TermTree<>(TermType.Feature);
141 157
		TermNode<Feature> root = result.getRoot();
142 158

  
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/description/TermTreeDaoImpl.java
21 21
import org.springframework.stereotype.Repository;
22 22

  
23 23
import eu.etaxonomy.cdm.model.description.Feature;
24
import eu.etaxonomy.cdm.model.term.TermTree;
25 24
import eu.etaxonomy.cdm.model.term.TermNode;
25
import eu.etaxonomy.cdm.model.term.TermTree;
26 26
import eu.etaxonomy.cdm.model.term.TermType;
27 27
import eu.etaxonomy.cdm.model.term.TermVocabulary;
28 28
import eu.etaxonomy.cdm.model.term.VocabularyEnum;
......
88 88
        return super.load(uuid);
89 89
    }
90 90

  
91
    private TermTree createDefaultFeatureTree() {
91
    private TermTree<Feature> createDefaultFeatureTree() {
92 92

  
93
        TermVocabulary featureVocabulary = termVocabularyDao.findByUuid(VocabularyEnum.Feature.getUuid());
93
        TermVocabulary<Feature> featureVocabulary = termVocabularyDao.findByUuid(VocabularyEnum.Feature.getUuid());
94 94

  
95 95
        List<Feature> featureList = new ArrayList<>(featureVocabulary.getTerms());
96 96
        List<Feature> selectedFeatures = new ArrayList<>();
......
99 99
                selectedFeatures.add(feature);
100 100
            }
101 101
        }
102
        TermTree featureTree = TermTree.NewInstance(selectedFeatures);
102
        TermTree<Feature> featureTree = TermTree.NewFeatureInstance(selectedFeatures);
103 103
        featureTree.setUuid(DefaultFeatureTreeUuid);
104 104
        return featureTree;
105 105
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)