Project

General

Profile

« Previous | Next » 

Revision 7a72a0fe

Added by Andreas Kohlbecker almost 6 years ago

ref #7386 reducing redundancy in name relationship handling methods, adding methods for general use

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NameRelationshipType.java
216 216
		}
217 217
	}
218 218

  
219
	/**
220
	 * @param type
221
	 * @return
222
	 */
223
	@Transient
224
	protected boolean isRelationshipType(NameRelationshipType type) {
225
	    if (type == null){
226
	        throw new IllegalStateException("NameRelationships have not been initialized yet. Please initialize DefinedTerms first");
227
	    }
228
	    return this.equals(type);
229
	}
230

  
219 231
	@Transient
220 232
	public boolean isBasionymRelation(){
221
		if (BASIONYM() == null){
222
			throw new IllegalStateException("NameRelationships have not been initialized yet. Please initialize DefinedTerms first");
223
		}
224
		return this.equals(BASIONYM());
233
        return isRelationshipType(BASIONYM());
225 234
	}
226 235

  
227 236
	@Transient
228 237
	public boolean isReplacedSynonymRelation(){
229
		if (REPLACED_SYNONYM() == null){
230
			throw new IllegalStateException("NameRelationships have not been initialized yet. Please initialize DefinedTerms first");
231
		}
232
		return this.equals(REPLACED_SYNONYM());
238
        return isRelationshipType(REPLACED_SYNONYM());
233 239
	}
234 240

  
235 241

  

Also available in: Unified diff