Interface DuplicateEnumValuesError

All Superinterfaces:
ErrorObject

public interface DuplicateEnumValuesError extends ErrorObject

Returned when an AttributeEnumType or AttributeLocalizedEnumType contains duplicate keys.


Example to create an instance using the builder pattern

     DuplicateEnumValuesError duplicateEnumValuesError = DuplicateEnumValuesError.builder()
             .message("{message}")
             .plusDuplicates(duplicatesBuilder -> duplicatesBuilder)
             .build()
 
  • Field Details

    • DUPLICATE_ENUM_VALUES

      static final String DUPLICATE_ENUM_VALUES
      discriminator value for DuplicateEnumValuesError
      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()

      "The enum values contain duplicate keys: $listOfDuplicateKeys."

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

      @NotNull @NotNull List<String> getDuplicates()

      Duplicate keys.

      Returns:
      duplicates
    • setMessage

      void setMessage(String message)

      "The enum values contain duplicate keys: $listOfDuplicateKeys."

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

      void setDuplicates(String... duplicates)

      Duplicate keys.

      Parameters:
      duplicates - values to be set
    • setDuplicates

      void setDuplicates(List<String> duplicates)

      Duplicate keys.

      Parameters:
      duplicates - values to be set
    • of

      factory method
      Returns:
      instance of DuplicateEnumValuesError
    • of

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

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

      builder factory method for DuplicateEnumValuesError
      Returns:
      builder
    • builder

      create builder for DuplicateEnumValuesError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withDuplicateEnumValuesError

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