Class Cs.EnumDeclaration

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

public static final class Cs.EnumDeclaration extends Object implements Cs, org.openrewrite.java.tree.Statement
Represents a C# enum declaration, including optional modifiers, attributes, and enum members.

For example:

     // Simple enum
     public enum Colors { Red, Green, Blue }

     // Enum with base type
     enum Flags : byte { None, All }

     // Enum with attributes and explicit values
     [Flags]
     internal enum Permissions {
         None = 0,
         Read = 1,
         Write = 2,
         ReadWrite = Read | Write
     }
 
  • Constructor Details

    • EnumDeclaration

      public EnumDeclaration()
  • Method Details

    • getName

      public org.openrewrite.java.tree.J.Identifier getName()
    • withName

      public Cs.EnumDeclaration withName(org.openrewrite.java.tree.J.Identifier name)
    • getBaseType

      public @Nullable org.openrewrite.java.tree.TypeTree getBaseType()
    • withBaseType

      public Cs.EnumDeclaration withBaseType(@Nullable org.openrewrite.java.tree.TypeTree baseType)
    • getMembers

      public @Nullable List<Cs.EnumMemberDeclaration> getMembers()
    • withMembers

      public Cs.EnumDeclaration withMembers(@Nullable List<Cs.EnumMemberDeclaration> members)
    • 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.Statement getCoordinates()
      Specified by:
      getCoordinates in interface org.openrewrite.java.tree.Statement
    • getPadding

      public Cs.EnumDeclaration.Padding getPadding()