Interface EntityReferenceFactory<R>
-
public interface EntityReferenceFactory<R>
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static EntityReferenceFactory<String>
asString()
R
createEntityReference(String typeName, Object identifier)
static <R> R
safeCreateEntityReference(EntityReferenceFactory<R> factory, String typeName, Object identifier, Consumer<Exception> exceptionSink)
-
-
-
Method Detail
-
createEntityReference
R 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 <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 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.
-
asString
static EntityReferenceFactory<String> asString()
-
-