java.lang.Object
java.lang.Throwable
java.lang.Exception
org.fuin.ddd4j.core.DuplicateEntityException
- All Implemented Interfaces:
Serializable,org.fuin.objects4j.common.ExceptionShortIdentifable
public final class DuplicateEntityException
extends Exception
implements org.fuin.objects4j.common.ExceptionShortIdentifable
Signals that an entity already existed in its parent.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDuplicateEntityException(@NotNull String parentIdPath, @NotNull String entityId) Constructor with string data.DuplicateEntityException(@NotNull EntityIdPath entityIdPath) Constructor with entity identifier path.DuplicateEntityException(@NotNull EntityIdPath parentIdPath, @NotNull EntityId entityId) Constructor with all data. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ELEMENT_NAME
Unique name of the element to use for XML and JSON marshalling/unmarshalling.- See Also:
-
SHORT_ID
Unique short identifier of this exception.- See Also:
-
-
Constructor Details
-
DuplicateEntityException
public DuplicateEntityException(@NotNull @NotNull EntityIdPath parentIdPath, @NotNull @NotNull EntityId entityId) Constructor with all data.- Parameters:
parentIdPath- Path from root to parent.entityId- Unique identifier of the entity that already existed.
-
DuplicateEntityException
Constructor with entity identifier path.- Parameters:
entityIdPath- Entity identifier path (from root to entity). Required to contain at least two elements.
-
DuplicateEntityException
public DuplicateEntityException(@NotNull @NotNull String parentIdPath, @NotNull @NotNull String entityId) Constructor with string data.- Parameters:
parentIdPath- Path from root to parent.entityId- Unique identifier of the entity that already existed.
-
-
Method Details
-
getShortId
- Specified by:
getShortIdin interfaceorg.fuin.objects4j.common.ExceptionShortIdentifable
-
getParentIdPath
Returns the path from root to parent.- Returns:
- Path.
-
getEntityId
Returns the unique identifier of the entity.- Returns:
- Unknown entity identifier.
-