Interface DuplicateFieldWithConflictingResourceError

All Superinterfaces:
ErrorObject

public interface DuplicateFieldWithConflictingResourceError extends ErrorObject

Returned when a field value conflicts with an existing value stored in a particular resource causing a duplicate.


Example to create an instance using the builder pattern

     DuplicateFieldWithConflictingResourceError duplicateFieldWithConflictingResourceError = DuplicateFieldWithConflictingResourceError.builder()
             .message("{message}")
             .field("{field}")
             .conflictingResource(conflictingResourceBuilder -> conflictingResourceBuilder)
             .build()
 
  • Field Details

    • DUPLICATE_FIELD_WITH_CONFLICTING_RESOURCE

      static final String DUPLICATE_FIELD_WITH_CONFLICTING_RESOURCE
      discriminator value for DuplicateFieldWithConflictingResourceError
      See Also:
  • 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()

      "A duplicate value $duplicateValue exists for field $field on $conflictingResource."

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

      @NotNull @NotNull String getField()

      Name of the conflicting field.

      Returns:
      field
    • getDuplicateValue

      @NotNull @NotNull Object getDuplicateValue()

      Conflicting duplicate value.

      Returns:
      duplicateValue
    • getConflictingResource

      @NotNull @Valid @NotNull @Valid Reference getConflictingResource()

      Reference to the resource that has the conflicting value.

      Returns:
      conflictingResource
    • setMessage

      void setMessage(String message)

      "A duplicate value $duplicateValue exists for field $field on $conflictingResource."

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

      void setField(String field)

      Name of the conflicting field.

      Parameters:
      field - value to be set
    • setDuplicateValue

      void setDuplicateValue(Object duplicateValue)

      Conflicting duplicate value.

      Parameters:
      duplicateValue - value to be set
    • setConflictingResource

      void setConflictingResource(Reference conflictingResource)

      Reference to the resource that has the conflicting value.

      Parameters:
      conflictingResource - value to be set
    • of

      factory method
      Returns:
      instance of DuplicateFieldWithConflictingResourceError
    • of

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

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

      builder factory method for DuplicateFieldWithConflictingResourceError
      Returns:
      builder
    • builder

      create builder for DuplicateFieldWithConflictingResourceError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDuplicateFieldWithConflictingResourceError

      default <T> T withDuplicateFieldWithConflictingResourceError(Function<DuplicateFieldWithConflictingResourceError,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<DuplicateFieldWithConflictingResourceError> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference