Class DuplicateEntityException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.fuin.ddd4j.ddd.DuplicateEntityException
All Implemented Interfaces:
Serializable, org.fuin.objects4j.common.ExceptionShortIdentifable, org.fuin.objects4j.common.MarshalInformation<DuplicateEntityException.Data>

public final class DuplicateEntityException extends Exception implements org.fuin.objects4j.common.ExceptionShortIdentifable, org.fuin.objects4j.common.MarshalInformation<DuplicateEntityException.Data>
Signals that an entity already existed in it's parent.
See Also:
  • Field Details

    • SHORT_ID

      public static final String SHORT_ID
      Unique short identifier of this exception.
      See Also:
    • ELEMENT_NAME

      public static final String ELEMENT_NAME
      Unique name of the element to use for XML and JSON marshalling/unmarshalling.
      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

      public DuplicateEntityException(@NotNull @NotNull EntityIdPath entityIdPath)
      Constructor with entity identifier path.
      Parameters:
      entityIdPath - Entity identifier path (from root to entity).
  • Method Details

    • getShortId

      public final String getShortId()
      Specified by:
      getShortId in interface org.fuin.objects4j.common.ExceptionShortIdentifable
    • getParentIdPath

      @NotNull public final @NotNull String getParentIdPath()
      Returns the path from root to parent.
      Returns:
      Path.
    • getEntityId

      @NotNull public final @NotNull String getEntityId()
      Returns the unique identifier of the entity.
      Returns:
      Unknown entity identifier.
    • getData

      public final DuplicateEntityException.Data getData()
      Returns the exception specific data.
      Specified by:
      getData in interface org.fuin.objects4j.common.MarshalInformation<DuplicateEntityException.Data>
      Returns:
      Data structure that can be marshalled/unmarshalled.
    • getDataClass

      public Class<DuplicateEntityException.Data> getDataClass()
      Specified by:
      getDataClass in interface org.fuin.objects4j.common.MarshalInformation<DuplicateEntityException.Data>
    • getDataElement

      public String getDataElement()
      Specified by:
      getDataElement in interface org.fuin.objects4j.common.MarshalInformation<DuplicateEntityException.Data>