*/
public class TaxonRelationshipTypeInverseContainer extends DefinedTermBase<DefinedTermBase> {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7225140304186547675L;
private boolean inverse;
private TaxonRelationshipType type;
+
/**
*
* @param sourceTaxon
return inverse;
}
+ /**
+ * returns the representation for the given language, when there is no representation for this language available, the english version is returned.
+ * @param language
+ * @return representation
+ *
+ */
public Representation getRepresentation(Language language){
- return inverse ? type.getInverseRepresentation(language) : type.getRepresentation(language);
+ Representation result;
+ result = inverse ? type.getInverseRepresentation(language) : type.getRepresentation(language);
+ if (result == null){
+ result = inverse ?
+ type.getInverseRepresentation(Language.getLanguageFromUuid(Language.uuidEnglish)) :
+ type.getRepresentation(Language.getLanguageFromUuid(Language.uuidEnglish));
+ }
+ return result;
}
+
+ /**
+ * returns the label of the TaxonRelationshipType for a given language, if the representation of the language is not available the english representation is returned.
+ * @param language
+ * @return label
+ */
public String getLabel(Language language){
+
return getRepresentation(language).getLabel();
}
}
public String getAbbreviatedLabel(){
- return getRepresentation(Language.ENGLISH()).getAbbreviatedLabel();
+ return getRepresentation(Language.getLanguageFromUuid(Language.uuidEnglish)).getAbbreviatedLabel();
}
public void setInverse(boolean inverse) {