Class StringIdMapper

java.lang.Object
org.impulsegraph.api.StringIdMapper
All Implemented Interfaces:
IdMapper<String>

public class StringIdMapper extends Object implements IdMapper<String>
High-performance thread-safe IdMapper for String external business keys.
  • Constructor Details

    • StringIdMapper

      public StringIdMapper(String domainType)
  • Method Details

    • getDomainType

      public String getDomainType()
      Description copied from interface: IdMapper
      Obtains the entity/domain name associated with this mapper.
      Specified by:
      getDomainType in interface IdMapper<String>
    • getOrAssignId

      public long getOrAssignId(String key)
      Description copied from interface: IdMapper
      Resolves an external key to a dense 64-bit node ID, assigning a new ID if absent.
      Specified by:
      getOrAssignId in interface IdMapper<String>
    • registerMapping

      public void registerMapping(String key, long denseId)
      Description copied from interface: IdMapper
      Registers a known external key to dense ID mapping (e.g. loaded from binary Section 4 or database).
      Specified by:
      registerMapping in interface IdMapper<String>
    • getExternalKey

      public String getExternalKey(long denseId)
      Description copied from interface: IdMapper
      Resolves a local dense node ID back to its external key.
      Specified by:
      getExternalKey in interface IdMapper<String>
    • getId

      public Long getId(String key)
      Description copied from interface: IdMapper
      Looks up the dense node ID for a given external key without assigning a new one. Returns null if absent.
      Specified by:
      getId in interface IdMapper<String>
    • size

      public int size()
      Description copied from interface: IdMapper
      Returns the total count of mapped IDs.
      Specified by:
      size in interface IdMapper<String>
    • clear

      public void clear()
      Description copied from interface: IdMapper
      Clears all in-memory mappings.
      Specified by:
      clear in interface IdMapper<String>