Project

General

Profile

« Previous | Next » 

Revision a7f996b4

Added by Katja Luther about 13 years ago

the deprecated methods call the new methods (#2176)

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java
288 288
	 * 						Use the {@link #putModifyingText(LanguageString) putModifyingText} method 
289 289
	 */
290 290
	public LanguageString addModifyingText(LanguageString description){
291
		return this.modifyingText.put(description.getLanguage(),description);
291
		return this.putModifyingText(description);
292 292
	}
293 293
	
294 294
	/**
......
318 318
	 * 					Use the {@link #putModifyingText(Language, String) putModifyingText} method
319 319
	 */
320 320
	public LanguageString addModifyingText(String text, Language language){
321
		return this.modifyingText.put(language, LanguageString.NewInstance(text, language));
321
		return this.putModifyingText(language, text);
322 322
	}
323 323
	
324 324
	/**
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/IndividualsAssociation.java
133 133
	 * @param description	the language string describing the individuals association
134 134
	 * 						in a particular language
135 135
	 * @see    	   			#getDescription()
136
	 * @see    	   			#addDescription(String, Language)
136
	 * @see    	   			#putDescription(Language, String)
137
	 * @deprecated 			should follow the put semantic of maps, this method will be removed in v4.0
138
	 * 						Use the {@link #putDescription(LanguageString) putDescription} method instead
137 139
	 */
138 140
	public void addDescription(LanguageString description){
141
		this.putDescription(description);
142
	}
143
	
144
	/**
145
	 * Adds a translated {@link LanguageString text in a particular language}
146
	 * to the {@link MultilanguageText multilanguage text} used to describe
147
	 * <i>this</i> individuals association.
148
	 * 
149
	 * @param description	the language string describing the individuals association
150
	 * 						in a particular language
151
	 * @see    	   			#getDescription()
152
	 * @see    	   			#putDescription(Language, String)
153
	 * 
154
	 */
155
	public void putDescription(LanguageString description){
139 156
		this.description.put(description.getLanguage(),description);
140 157
	}
141 158
	/**
......
147 164
	 * 					in a particular language
148 165
	 * @param language	the language in which the text string is formulated
149 166
	 * @see    	   		#getDescription()
150
	 * @see    	   		#addDescription(LanguageString)
167
	 * @see    	   		#putDescription(LanguageString)
151 168
	 */
152
	public void addDescription(String text, Language language){
169
	public void putDescription(Language language, String text){
153 170
		this.description.put(language, LanguageString.NewInstance(text, language));
154 171
	}
172
	
173
	/**
174
	 * Creates a {@link LanguageString language string} based on the given text string
175
	 * and the given {@link Language language} and adds it to the {@link MultilanguageText multilanguage text} 
176
	 * used to describe <i>this</i> individuals association.
177
	 * 
178
	 * @param text		the string describing the individuals association
179
	 * 					in a particular language
180
	 * @param language	the language in which the text string is formulated
181
	 * @see    	   		#getDescription()
182
	 * @see    	   		#putDescription(LanguageString)
183
	 * @deprecated		should follow the put semantic of maps, this method will be removed in v4.0
184
	 * 					Use the {@link #putDescription(Language, String) putDescription} method instead
185
	 */
186
	public void addDescription(String text, Language language){
187
		this.putDescription(language, text);
188
	}
155 189
	/** 
156 190
	 * Removes from the {@link MultilanguageText multilanguage text} used to describe
157 191
	 * <i>this</i> individuals association the one {@link LanguageString language string}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/PolytomousKeyNode.java
533 533
	 * 						Use the {@link #putModifyingText(LanguageString) putModifyingText} method instead
534 534
	 */
535 535
	public LanguageString addModifyingText(LanguageString description){
536
		return this.modifyingText.put(description.getLanguage(),description);
536
		return this.putModifyingText(description);
537 537
	}
538 538
	
539 539
	/**
......
564 564
	 * 					Use the {@link #putModifyingText(Language, String) putModifyingText} method instead
565 565
	 */
566 566
	public LanguageString addModifyingText(String text, Language language){
567
		return this.modifyingText.put(language, LanguageString.NewInstance(text, language));
567
		return this.putModifyingText(language, text);
568 568
	}
569 569
	
570 570
	/**
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/StateData.java
179 179
	 */
180 180
	@Deprecated
181 181
	public LanguageString addModifyingText(String text, Language language){
182
		return this.modifyingText.put(language, LanguageString.NewInstance(text, language));
182
		return this.putModifyingText(language, text);
183 183
	}
184 184
	
185 185
	/**
......
211 211
	 */
212 212
	@Deprecated
213 213
	public LanguageString addModifyingText(LanguageString text){
214
		return this.modifyingText.put(text.getLanguage(),text);
214
		return this.putModifyingText(text);
215 215
	}
216 216
	
217 217
	/**
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TaxonInteraction.java
160 160
	 * @param description	the language string describing the taxon interaction
161 161
	 * 						in a particular language
162 162
	 * @see    	   			#getDescription()
163
	 * @see    	   			#addDescription(String, Language)
163
	 * @see    	   			#putDescription(String, Language)
164
	 * @deprecated			should follow the put semantic of maps, this method will be removed in v4.0
165
	 * 						Use the {@link #putDescription(LanguageString) putDescription} method instead
164 166
	 */
165 167
	public void addDescription(LanguageString description){
168
		this.putDescription(description);
169
	}
170
	
171
	/**
172
	 * Adds a translated {@link LanguageString text in a particular language}
173
	 * to the {@link MultilanguageText multilanguage text} used to describe
174
	 * <i>this</i> taxon interaction.
175
	 * 
176
	 * @param description	the language string describing the taxon interaction
177
	 * 						in a particular language
178
	 * @see    	   			#getDescription()
179
	 * @see    	   			#putDescription(String, Language)
180
	 */
181
	public void putDescription(LanguageString description){
166 182
		this.description.put(description.getLanguage(),description);
167 183
	}
184
	/**
185
	 * Creates a {@link LanguageString language string} based on the given text string
186
	 * and the given {@link Language language} and adds it to the {@link MultilanguageText multilanguage text} 
187
	 * used to describe <i>this</i> taxon interaction.
188
	 * 
189
	 * @param text		the string describing the taxon interaction
190
	 * 					in a particular language
191
	 * @param language	the language in which the text string is formulated
192
	 * @see    	   		#getDescription()
193
	 * @see    	   		#putDescription(LanguageString)
194
	 */
195
	public void putDescription(Language language, String text){
196
		this.description.put(language, LanguageString.NewInstance(text, language));
197
	}
198
	
168 199
	/**
169 200
	 * Creates a {@link LanguageString language string} based on the given text string
170 201
	 * and the given {@link Language language} and adds it to the {@link MultilanguageText multilanguage text} 
......
175 206
	 * @param language	the language in which the text string is formulated
176 207
	 * @see    	   		#getDescription()
177 208
	 * @see    	   		#addDescription(LanguageString)
209
	 * @deprecated 		should follow the put semantic of maps, this method will be removed in v4.0
210
	 * 					Use the {@link #putDescription(Language, String) putDescription} method instead
178 211
	 */
179 212
	public void addDescription(String text, Language language){
180
		this.description.put(language, LanguageString.NewInstance(text, language));
213
		this.putDescription(language, text);
181 214
	}
182 215
	/** 
183 216
	 * Removes from the {@link MultilanguageText multilanguage text} used to describe
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/TextData.java
266 266
	 * 					Use the {@link #putText(Language, String) putText} method instead
267 267
	 */
268 268
	public LanguageString putText(String text, Language language) {
269
		fixHashMapHibernateBug();
270
		//** end workaround
271
		LanguageString languageString = multilanguageText.get(language);
272
		if (languageString != null){
273
			languageString.setText(text);
274
		}else{
275
			languageString = LanguageString.NewInstance(text, language);
276
		}
277
		LanguageString result = this.multilanguageText.put(language , languageString);
278
		return (result == null ? null : result);
269
		return this.putText(language, text);
279 270
	}
280 271
	
281 272
	/**
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/media/Media.java
235 235
	 */
236 236
	@Deprecated
237 237
	public void addTitle(LanguageString title){
238
		this.title.put(title.getLanguage(), title);
238
		this.putTitle(title);
239 239
	}
240 240
	public void putTitle(LanguageString title){
241 241
		this.title.put(title.getLanguage(), title);
......
255 255
	 */
256 256
	@Deprecated
257 257
	public void addTitle(String title, Language language){
258
		this.title.put(language, LanguageString.NewInstance(title, language));
258
		this.putTitle(language, title);
259 259
	}
260 260
	/**
261 261
	 * Creates a {@link LanguageString language string} based on the given text string
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/SpecimenOrObservationBase.java
311 311
	 */
312 312
	@Deprecated
313 313
	public void addDefinition(LanguageString description){
314
		this.definition.put(description.getLanguage(),description);
314
		this.putDefinition(description);
315 315
	}
316 316
	/**
317 317
	 * adds the {@link LanguageString description} to the {@link MultilanguageText multilanguage text} 
......
340 340
	 */
341 341
	@Deprecated
342 342
	public void addDefinition( String text, Language language){
343
		this.definition.put(language, LanguageString.NewInstance(text, language));
343
		this.putDefinition(language, text);
344 344
	}
345 345
	/**
346 346
	 * Creates a {@link LanguageString language string} based on the given text string

Also available in: Unified diff