internal static string ParseSnakType(SnakType value) { switch (value) { case SnakType.Value: return("value"); case SnakType.SomeValue: return("somevalue"); case SnakType.NoValue: return("novalue"); default: throw new ArgumentException("Invalid SnackType value.", nameof(value)); } }
/// <summary> /// Initializes a snak with specified property ID and snak type. /// </summary> /// <param name="propertyId">The property id.</param> /// <param name="snakType">Snak type.</param> /// <remarks> /// If you set <paramref name="snakType"/> to <see cref="SnakType.Value"/>, remember to set /// <see cref="DataType"/> and <see cref="DataValue"/> to valid values afterwards. /// </remarks> public Snak(string propertyId, SnakType snakType) { PropertyId = propertyId ?? throw new ArgumentNullException(nameof(propertyId)); SnakType = snakType; }