Interface EntityReferenceFactory


public interface EntityReferenceFactory
  • Method Details

    • createEntityReference

      EntityReference createEntityReference(String typeName, Object identifier)
      Parameters:
      typeName - The name of the entity type.
      identifier - The identifier of the entity.
      Returns:
      A reference to the entity.
      Throws:
      RuntimeException - If something goes wrong (exception while rendering an identifier, ...)
    • safeCreateEntityReference

      static EntityReference safeCreateEntityReference(EntityReferenceFactory factory, String typeName, Object identifier, Consumer<Exception> exceptionSink)
      Parameters:
      factory - The factory for entity references.
      typeName - The name of the entity type.
      identifier - The identifier of the entity.
      exceptionSink - A sink for exceptions thrown during the execution of this method. Any exception thrown while creating the entity reference should be put into that sink and should not be propagated.
      Returns:
      A reference to the entity, or null if an exception was thrown while creating the entity reference.