NodePipeline/NodePipeline.Engine.Abstractions/Validation/NodePortInfo.cs
2026-01-02 20:55:25 +03:00

28 lines
923 B
C#

using System;
// ReSharper disable ClassNeverInstantiated.Global
// ReSharper disable MemberCanBePrivate.Global
namespace NodePipeline.Engine.Abstractions.Validation;
public sealed class NodePortInfo(
string name,
Type type,
bool isNullable,
bool required,
bool disallowNullableInput,
bool input)
{
public string Name { get; } = name ?? throw new ArgumentNullException(nameof(name));
public Type Type { get; } = type ?? throw new ArgumentNullException(nameof(type));
public bool IsNullable { get; } = isNullable;
public bool Required { get; } = required;
public bool DisallowNullableInput { get; } = disallowNullableInput;
public bool Input { get; } = input;
public override string ToString()
{
return
$"{Name}:{Type.Name}{(IsNullable ? "?" : "")}, Req={Required}, DisallowNull={DisallowNullableInput}, {(Input ? "Input" : "Output")}";
}
}