Enum Class TypeStyle

java.lang.Object
java.lang.Enum<TypeStyle>
cs1302.tracer.api.TypeStyle
All Implemented Interfaces:
Serializable, Comparable<TypeStyle>, Constable

@API(status=STABLE, since="4.0.0") public enum TypeStyle extends Enum<TypeStyle>
Represents the type qualification style used when rendering types in stack frames, object labels, variable attributes, and reconstructed lambda return and parameter types. Lambda bodies retain their captured text.
  • Enum Constant Details

    • FQN

      public static final TypeStyle FQN
      Fully qualified type names (e.g., java.lang.String, pkg.Pair<java.lang.String, java.lang.Integer>).
    • SIMPLE

      public static final TypeStyle SIMPLE
      Simplified type names without package prefixes (e.g., String, Pair<String, Integer>).
  • Method Details

    • values

      public static TypeStyle[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TypeStyle valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • format

      public String format(String typeName)
      Formats the given type name according to this type style.
      Parameters:
      typeName - The raw type name string (may be fully qualified or generic).
      Returns:
      The formatted type name string, or null if input is null.
    • simplify

      public static String simplify(String typeName)
      Simplifies a fully qualified or parameterized type string by stripping dotted identifier prefixes. This is a textual presentation operation, not Java type parsing or name resolution.
      Parameters:
      typeName - The type string to simplify, or null.
      Returns:
      The simplified type string, or null if the input is null.
    • toString

      public String toString()
      Gets the string representation of this TypeStyle.
      Overrides:
      toString in class Enum<TypeStyle>
      Returns:
      The string identifier.