org.neo4j.graphdb.index

Class UniqueFactory<T extends PropertyContainer>

    • Method Detail

      • 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.
      • getOrCreateWithOutcome

        public final UniqueFactory.UniqueEntity<T> getOrCreateWithOutcome(String key,
                                                                          Object value)
        Get the indexed entity, creating it (exactly once) if no indexed entity exists. Includes the outcome, i.e. whether the entity was created or not.
        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 as well as whether or not it was created, wrapped in a UniqueFactory.UniqueEntity.

Copyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.