using System;

// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global

namespace NodePipeline.Abstractions.Attributes;

/// <summary>
///     Specifies default value for parameter
/// </summary>
[AttributeUsage(AttributeTargets.Property)]
public sealed class HasDefaultValueAttribute : Attribute
{
    /// <summary>
    ///     Specifies default value for parameter
    /// </summary>
    /// <param name="value">Default value</param>
    /// <param name="type">Default value type</param>
    public HasDefaultValueAttribute(object value, Type type)
    {
        Value = value;
        Type = type;
    }

    /// <summary>
    ///     Specifies default value for parameter
    /// </summary>
    /// <param name="value">Default string value</param>
    public HasDefaultValueAttribute(string value)
    {
        Value = value;
        Type = typeof(string);
    }

    /// <summary>
    ///     Specifies default value for parameter
    /// </summary>
    /// <param name="value">Default integer value</param>
    public HasDefaultValueAttribute(int value)
    {
        Value = value;
        Type = typeof(int);
    }

    /// <summary>
    ///     Specifies default value for parameter
    /// </summary>
    /// <param name="value">Default decimal value</param>
    public HasDefaultValueAttribute(decimal value)
    {
        Value = value;
        Type = typeof(decimal);
    }

    /// <summary>
    ///     Default value
    /// </summary>
    public object Value { get; }

    /// <summary>
    ///     Default value type
    /// </summary>
    public Type Type { get; }
}