Record Class StringConcatRewriteOutcome

java.lang.Object
java.lang.Record
org.ek9lang.compiler.repair.StringConcatRewriteOutcome

public record StringConcatRewriteOutcome(String status, String modifiedSource, String errorMessage, String metaOutcome, Integer rewrittenLine, Integer operandCount, Integer substitutionCount, Integer escapedBacktickCount, Integer escapedDollarCount, String originalSlice, String rewrittenSlice, List<StringConcatRewriteOutcome.Conflict> conflicts) extends Record
Outcome of a StringConcatRewriter call. Three terminal states — applied, conflicts, error. The metaOutcome discriminator carries the load-bearing distinction between "rewritten" (concat replaced with backtick literal) and "already-in-target-form" (selection was already a backtick or single double-quoted literal — idempotent no-op).

See docs/tooling/tools/ek9_rewrite_string_concat.md for the full design (conflict kinds, escape handling, operand admissibility).

  • Constructor Details

    • StringConcatRewriteOutcome

      public StringConcatRewriteOutcome(String status, String modifiedSource, String errorMessage, String metaOutcome, Integer rewrittenLine, Integer operandCount, Integer substitutionCount, Integer escapedBacktickCount, Integer escapedDollarCount, String originalSlice, String rewrittenSlice, List<StringConcatRewriteOutcome.Conflict> conflicts)
      Creates an instance of a StringConcatRewriteOutcome record class.
      Parameters:
      status - the value for the status record component
      modifiedSource - the value for the modifiedSource record component
      errorMessage - the value for the errorMessage record component
      metaOutcome - the value for the metaOutcome record component
      rewrittenLine - the value for the rewrittenLine record component
      operandCount - the value for the operandCount record component
      substitutionCount - the value for the substitutionCount record component
      escapedBacktickCount - the value for the escapedBacktickCount record component
      escapedDollarCount - the value for the escapedDollarCount record component
      originalSlice - the value for the originalSlice record component
      rewrittenSlice - the value for the rewrittenSlice record component
      conflicts - the value for the conflicts record component
  • Method Details

    • rewritten

      public static StringConcatRewriteOutcome rewritten(String modifiedSource, int rewrittenLine, int operandCount, int substitutionCount, int escapedBacktickCount, int escapedDollarCount, String originalSlice, String rewrittenSlice)
    • alreadyInTargetForm

      public static StringConcatRewriteOutcome alreadyInTargetForm(String originalSource, int rewrittenLine)
    • conflicts

    • error

      public static StringConcatRewriteOutcome error(String message)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • status

      public String status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • modifiedSource

      public String modifiedSource()
      Returns the value of the modifiedSource record component.
      Returns:
      the value of the modifiedSource record component
    • errorMessage

      public String errorMessage()
      Returns the value of the errorMessage record component.
      Returns:
      the value of the errorMessage record component
    • metaOutcome

      public String metaOutcome()
      Returns the value of the metaOutcome record component.
      Returns:
      the value of the metaOutcome record component
    • rewrittenLine

      public Integer rewrittenLine()
      Returns the value of the rewrittenLine record component.
      Returns:
      the value of the rewrittenLine record component
    • operandCount

      public Integer operandCount()
      Returns the value of the operandCount record component.
      Returns:
      the value of the operandCount record component
    • substitutionCount

      public Integer substitutionCount()
      Returns the value of the substitutionCount record component.
      Returns:
      the value of the substitutionCount record component
    • escapedBacktickCount

      public Integer escapedBacktickCount()
      Returns the value of the escapedBacktickCount record component.
      Returns:
      the value of the escapedBacktickCount record component
    • escapedDollarCount

      public Integer escapedDollarCount()
      Returns the value of the escapedDollarCount record component.
      Returns:
      the value of the escapedDollarCount record component
    • originalSlice

      public String originalSlice()
      Returns the value of the originalSlice record component.
      Returns:
      the value of the originalSlice record component
    • rewrittenSlice

      public String rewrittenSlice()
      Returns the value of the rewrittenSlice record component.
      Returns:
      the value of the rewrittenSlice record component
    • conflicts

      Returns the value of the conflicts record component.
      Returns:
      the value of the conflicts record component