org.neo4j.graphdb.index
Class UniqueFactory<T extends PropertyContainer>
java.lang.Object
org.neo4j.graphdb.index.UniqueFactory<T>
- Type Parameters:
T - the type of entity created by this UniqueFactory.
- Direct Known Subclasses:
- UniqueFactory.UniqueNodeFactory, UniqueFactory.UniqueRelationshipFactory
public abstract class UniqueFactory<T extends PropertyContainer>
- extends Object
A utility class for creating unique (with regard to a given index) entities.
Uses the putIfAbsent() method of the referenced index.
- Author:
- Tobias Lindaaker
|
Method Summary |
T |
getOrCreate(String key,
Object value)
Get the indexed entity, creating it (exactly once) if no indexed entity exists. |
getOrCreate
public final T getOrCreate(String key,
Object value)
- Get the indexed entity, creating it (exactly once) if no indexed entity exists.
- Parameters:
key - the key to find the entity under in the index.value - the value the key is mapped to for the entity in the index.
- Returns:
- the unique entity in the index.
Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.