18 using System.Text.RegularExpressions;
19 using Newtonsoft.Json;
28 private readonly Regex _targetTemplate =
new Regex(
"['(.+)']");
29 private string _target;
39 _target = value !=
null ?
string.Join(
".", value.Split(
'.').Select(s => _targetTemplate.Match(s).Success ? s : $
"['{s}']")) : value;
58 protected Objective(
string target, decimal? targetValue)
60 if (
string.IsNullOrEmpty(target))
62 throw new ArgumentNullException(nameof(target),
Messages.
Objective.NullOrEmptyObjective);
65 var objective = target;
66 if (!objective.Contains(
"."))
69 objective = $
"Statistics.{objective}";
76 #region Backwards Compatibility
82 [JsonProperty(
"target-value")]
83 private decimal? OldTargetValue