/*
* Author:          Patrick-Christopher Mattulat
* Co-Author:       Claude Sonnet 4.6 (LLM)
* Company:         Lynar Studios
* E-Mail:          webmaster@lynarstudios.com
* Created:         2023-02-10
* Changed:         2026-06-23
*
* */

#include <ls-std/core/exception/IllegalArgumentException.hpp>
#include <ls-std/io/section-pair/SectionPairMessageFormatter.hpp>
#include <ls-std/io/section-pair/evaluator/SectionPairValueArgumentEvaluator.hpp>
#include <ls-std/io/section-pair/validator/SectionPairValueValidator.hpp>

using ls::standard::core::Class;
using ls::standard::core::IllegalArgumentException;
using ls::standard::io::section_pair_row_value;
using ls::standard::io::SectionPairMessageFormatter;
using ls::standard::io::SectionPairValueArgumentEvaluator;
using ls::standard::io::SectionPairValueValidator;
using std::move;
using std::string;

SectionPairValueArgumentEvaluator::SectionPairValueArgumentEvaluator(section_pair_row_value _value) : Class("SectionPairValueArgumentEvaluator"), value(::move(_value))
{}

SectionPairValueArgumentEvaluator::~SectionPairValueArgumentEvaluator() noexcept = default;

void SectionPairValueArgumentEvaluator::evaluate()
{
  if (!SectionPairValueValidator(this->value).isValid())
  {
    const string message = "\"" + this->value + "\" is not a valid value!";
    throw IllegalArgumentException{SectionPairMessageFormatter::getFormattedMessage(message)};
  }
}
