class QueueDetail {

  public QueueConfig toConfig() {
    QueueConfig queueConfig =
        QueueConfig.builder()
            .name(name)
            .numRetry(numRetry)
            .queueName(queueName)
            .delayedQueueName(delayedQueueName)
            .processingQueueName(processingQueueName)
            .visibilityTimeout(visibilityTimeout)
            .createdOn(System.currentTimeMillis())
            .updatedOn(System.currentTimeMillis())
            .deadLetterQueues(new LinkedList<>())
            .concurrency(concurrency.toMinMax())
            .priority(Collections.unmodifiableMap(priority))
            .priorityGroup(priorityGroup)
            .systemGenerated(systemGenerated)
            .build();
    if (isDlqSet()) {
      queueConfig.addDeadLetterQueue(getDeadLetterQueue());
    }
    return queueConfig;
  }

}