Interface GraphEntities<E extends GraphEntity>

    • Method Detail

      • getByXmlId

        static <EE extends GraphEntity> EE getByXmlId​(GraphEntities<EE> container,
                                                      String xmlId)
        find by XML id Note: not an efficient implementation since it loops over all entities in linear time to identify the correct one, preferably use MapWrapper.get(Object) instead whenever possible.
        Type Parameters:
        EE - entity type
        Parameters:
        container - the container to apply to
        xmlId - to find match for
        Returns:
        found match, null if none found
      • getFactory

        GraphEntityFactory<E> getFactory()
        Factory to create instance of graph entity (for this container class)
        Returns:
        entity factory
      • deepClone

        GraphEntities<E> deepClone()
        Deep clone implementation
        Returns:
        deep copy of entities
      • deepCloneWithMapping

        GraphEntities<E> deepCloneWithMapping​(BiConsumer<E,​E> graphEntityMapper)
        Deep clone implementation with mapping retained between original and copies created
        Parameters:
        graphEntityMapper - that is applied to each deep copy entity mapping pair of origin and copy
        Returns:
        pair with deep copy of entities and mapping from original entities to deep copies of these entities
      • getByXmlId

        E getByXmlId​(String xmlId)
        Return an entity by its XML id
        Parameters:
        xmlId - the XML id of the entity
        Returns:
        the specified entity instance
      • getByExternalId

        default Collection<E> getByExternalId​(String externalId)
        Collect all entities based on a matching external id. Entities are not indexed by external id so this is a very inefficient linear search through all registered entities.
        Parameters:
        externalId - to match
        Returns:
        found matching links
      • forEachMatchingIdIn

        default <T extends IdAble> void forEachMatchingIdIn​(Iterable<T> values,
                                                            Consumer<T> consumer)
        Apply provided consumer to each element in values as long as that element is registered under the same id.
        Type Parameters:
        T - values type
        Parameters:
        values - to apply consumer to when they are registered in this wrapper
        consumer - to apply