using System;
using System.Collections.Generic;

namespace Toolbox.Docking.Api.Objects.Profiler
{
    /// <summary>
    /// Relevant metadata table for a profiler category node.
    /// </summary>
    [Serializable]
    public sealed class TbToxicologicalProfilerInfoItem
    {
        /// <summary>
        /// The metadata label e.g. Organ
        /// </summary>
        public string Label { get; }

        /// <summary>
        /// The metadata value e.g. Liver
        /// </summary>
        public string Value { get; }

        /// <summary>
        /// Constructor for the info item.
        /// </summary>
        /// <param name="label">The metadata label e.g. Organ</param>
        /// <param name="value">The metadata value e.g. Liver</param>
        /// <param name="childs">Sub-nodes list.</param>
        public TbToxicologicalProfilerInfoItem(string label, string value, IEnumerable<TbToxicologicalProfilerInfoItem> childs)
        {
            Label = label;
            Value = value;
            Children = childs == null
                ? new List<TbToxicologicalProfilerInfoItem>()
                : new List<TbToxicologicalProfilerInfoItem>(childs);
        }

        /// <summary>
        /// Sub-nodes list.
        /// </summary>
        public IReadOnlyList<TbToxicologicalProfilerInfoItem> Children { get; }
    }
}