Class ManagedIdEntitiesImpl<E extends ManagedId>

    • Field Detail

      • managedIdClass

        protected final Class<? extends ManagedId> managedIdClass
        the class signature used for generating the managed id within the group defined by the token
    • Constructor Detail

      • ManagedIdEntitiesImpl

        protected ManagedIdEntitiesImpl​(Function<E,​Long> valueToKey,
                                        Class<? extends ManagedId> managedIdClass)
        Constructor
        Parameters:
        valueToKey - the mapping from key to value of the graph entity
        managedIdClass - should reflect the class signature used for generating the managed id of this class when creating it via the factory of this container
      • ManagedIdEntitiesImpl

        protected ManagedIdEntitiesImpl​(ManagedIdEntitiesImpl<E> other)
        copy constructor
        Parameters:
        other - to copy
    • Method Detail

      • updateIdMapping

        protected void updateIdMapping()
        updates the container keys based on currently presiding ids. Only to be used when an external force has changed already registered edges' their ids
      • getManagedIdClass

        public Class<? extends ManagedId> getManagedIdClass()
        Collect the class identifier used for the managed ids within the id group for instances of this class used in this container
        Specified by:
        getManagedIdClass in interface ManagedIdEntities<E extends ManagedId>
        Returns:
        managedIdClass for instances this factory creates
      • recreateIds

        public void recreateIds​(boolean resetManagedIdClass)
        Recreate the ids for all registered entities with or without resetting
        Specified by:
        recreateIds in interface ManagedIdEntities<E extends ManagedId>
        Parameters:
        resetManagedIdClass - when true we reset the managedId's counter to zero (via its id class) before recreating the ids, otherwise we simply recreate the managed id by starting with the next available id without resetting
      • reset

        public void reset()
        When reset it called, it not only clears the entries, but also resets the managedids, such that when the container is reused the managed ids start from zero again. If any entries are managedEntities themselves or contain managed entities themselves, they are reset as well
        Specified by:
        reset in interface ManagedIdEntities<E extends ManagedId>