using System.Linq;

namespace InABox.Mobile
{
    public class StringArrayToBooleanConverter : AbstractConverter<string[],bool>
    {
        public bool HasValue { get; set; }

        protected override bool Convert(string[] value, object? parameter = null)
        {
            var empty = value?.Any() != true;
            return HasValue 
                ? !empty 
                : empty;
        }

        public StringArrayToBooleanConverter()
        {
            HasValue = true;
        }
        
    }
}