Class Cs.PositionalPatternClause

java.lang.Object
org.openrewrite.csharp.tree.Cs.PositionalPatternClause
All Implemented Interfaces:
Cs, org.openrewrite.java.tree.J, org.openrewrite.Tree
Enclosing interface:
Cs

public static final class Cs.PositionalPatternClause extends Object implements Cs
Represents a positional pattern clause in C# pattern matching, which matches the deconstructed parts of an object.

For example:

     // Simple positional pattern
     if (point is (0, 0))

     // With variable declarations
     if (point is (int x, int y))

     // With nested patterns
     if (point is (> 0, < 100))

     // In switch expressions
     return point switch {
         (0, 0) => "origin",
         (var x, var y) when x == y => "on diagonal",
         _ => "other"
     };