public static SignaturePart Alternatives([ItemNotNull][NotNull] IEnumerable <SignaturePart> parts, [CanBeNull] string name = null) { var result = AlternativesPart.From(parts); result.Name = name; return(result); }
protected override JObject Visit(AlternativesPart part) { return(new JObject { ["$or"] = new JArray(part.Alternatives.Select(a => a.AcceptForValue(this))) }); }
public static SignaturePart From([NotNull] SignaturePart inner) { if (inner is AlternativesPart ap) { return(AlternativesPart.From(ap.Alternatives.Select(From))); } return(new QuotedPart(inner)); }
public void Visit(AlternativesPart part) { sb.Append('{'); VisitWithDelimiter(part.Alternatives, " | "); sb.Append('}'); }
void ISignatureVisitor.Visit(AlternativesPart part) => result = Visit(part);
protected abstract T Visit([NotNull] AlternativesPart part);