public IdentityObjectRelationshipType convertToRelationshipType(Object value) {
if (value instanceof String) {
String key = RELATIONSHIP_TYPE_CACHE_PREFIX + (String) value;
if (cache.containsKey(key)) return (IdentityObjectRelationshipType) cache.get(key);
IdentityObjectRelationshipType type = new IdentityObjectRelationshipTypeImpl((String) value);
cache.put(key, type);
return type;
} else {
if (cache.containsKey(value)) return (IdentityObjectRelationshipType) cache.get(value);
IdentityObjectRelationshipType type = new IdentityObjectRelationshipTypeImpl(
(String) relationshipTypeNameProperty.getValue(value));
cache.put(value, type);
return type;
}
}