Interface ReferenceExistsError

All Superinterfaces:
ErrorObject

public interface ReferenceExistsError extends ErrorObject

Returned when a resource cannot be deleted because it is being referenced by another resource.


Example to create an instance using the builder pattern

     ReferenceExistsError referenceExistsError = ReferenceExistsError.builder()
             .message("{message}")
             .build()
 
  • Field Details

  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()

      "Can not delete a $resource while it is referenced by at least one $referencedBy."

      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getReferencedBy

      ReferenceTypeId getReferencedBy()

      Type of referenced resource.

      Returns:
      referencedBy
    • setMessage

      void setMessage(String message)

      "Can not delete a $resource while it is referenced by at least one $referencedBy."

      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setReferencedBy

      void setReferencedBy(ReferenceTypeId referencedBy)

      Type of referenced resource.

      Parameters:
      referencedBy - value to be set
    • of

      static ReferenceExistsError of()
      factory method
      Returns:
      instance of ReferenceExistsError
    • of

      factory method to create a shallow copy ReferenceExistsError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ReferenceExistsError
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ReferenceExistsErrorBuilder builder()
      builder factory method for ReferenceExistsError
      Returns:
      builder
    • builder

      create builder for ReferenceExistsError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withReferenceExistsError

      default <T> T withReferenceExistsError(Function<ReferenceExistsError,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ReferenceExistsError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference