Class Cs.TupleType

java.lang.Object
org.openrewrite.csharp.tree.Cs.TupleType
All Implemented Interfaces:
Cs, org.openrewrite.java.tree.Expression, org.openrewrite.java.tree.J, org.openrewrite.java.tree.NameTree, org.openrewrite.java.tree.TypedTree, org.openrewrite.java.tree.TypeTree, org.openrewrite.Tree
Enclosing interface:
Cs

public static class Cs.TupleType extends Object implements Cs, org.openrewrite.java.tree.TypeTree, org.openrewrite.java.tree.Expression
Represents a C# tuple type specification, which allows grouping multiple types into a single type. Can be used in method returns, variable declarations, etc.

For example:

   // Simple tuple type
   (int, string) coordinates;

   // Tuple type with named elements
   (int x, string label) namedTuple;

   // Nested tuple types
   (int, (string, bool)) complexTuple;

   // As method return type
   public (string name, int age) GetPersonDetails() { }

   // As parameter type
   public void ProcessData((int id, string value) data) { }
 
  • Constructor Details

    • TupleType

      public TupleType()
  • Method Details

    • getElements

      public List<Cs.TupleElement> getElements()
    • withElements

      public Cs.TupleType withElements(List<Cs.TupleElement> elements)
    • acceptCSharp

      public <P> org.openrewrite.java.tree.J acceptCSharp(CSharpVisitor<P> v, P p)
      Specified by:
      acceptCSharp in interface Cs
    • getCoordinates

      public org.openrewrite.java.tree.CoordinateBuilder.Expression getCoordinates()
      Specified by:
      getCoordinates in interface org.openrewrite.java.tree.Expression
    • getPadding

      public Cs.TupleType.Padding getPadding()