Interface EntityReferenceFactory<R>
public interface EntityReferenceFactory<R>
-
Method Summary
Modifier and TypeMethodDescriptionstatic EntityReferenceFactory<String>asString()createEntityReference(String typeName, Object identifier) static <R> RsafeCreateEntityReference(EntityReferenceFactory<R> factory, String typeName, Object identifier, Consumer<Exception> exceptionSink)
-
Method Details
-
createEntityReference
- 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 <R> R safeCreateEntityReference(EntityReferenceFactory<R> factory, String typeName, Object identifier, Consumer<Exception> exceptionSink) - Type Parameters:
R- The type of entity reference.- 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 beput intothat sink and should not be propagated.- Returns:
- A reference to the entity, or null if an exception was thrown while creating the entity reference.
-
asString
-