Class Cs.DefaultSwitchLabel

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

public static final class Cs.DefaultSwitchLabel extends Object implements Cs, Cs.SwitchLabel, org.openrewrite.java.tree.Expression
Represents a default case label in a switch statement.

For example:

 switch(value) {
     case 1:
         break;
     default:      // default label
         Console.WriteLine("default");
         break;
 }

 // Also used in switch expressions
 var result = value switch {
     1 => "one",
     default => "other"
 };
 
  • Constructor Details

    • DefaultSwitchLabel

      public DefaultSwitchLabel()
  • Method Details

    • getType

      public org.openrewrite.java.tree.JavaType getType()
      Specified by:
      getType in interface org.openrewrite.java.tree.Expression
    • withType

      public Cs.DefaultSwitchLabel withType(@Nullable org.openrewrite.java.tree.JavaType type)
      Specified by:
      withType in interface org.openrewrite.java.tree.Expression
    • 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