Record Class McpCodingPartnerDiff

java.lang.Object
java.lang.Record
com.shaft.mcp.McpCodingPartnerDiff
Record Components:
schemaVersion - response schema version
targetSourcePath - repository-relative Java target path
insertionAnchor - method or textual anchor the insertion was placed after
targetExists - whether the target file already exists
insertedLineCount - number of lines the diff would add
unifiedDiff - standard unified-diff text the client can render or apply
warnings - preview-only and guardrail reminders

public record McpCodingPartnerDiff(String schemaVersion, String targetSourcePath, String insertionAnchor, boolean targetExists, int insertedLineCount, String unifiedDiff, List<String> warnings) extends Record
Preview-only unified diff that inserts reviewed SHAFT code into an existing Java target.

The diff is never written to disk by the MCP server. IntelliJ (or another client) shows the preview and applies it only under explicit user approval.

  • Constructor Details

    • McpCodingPartnerDiff

      public McpCodingPartnerDiff(String schemaVersion, String targetSourcePath, String insertionAnchor, boolean targetExists, int insertedLineCount, String unifiedDiff, List<String> warnings)
      Creates an immutable coding partner diff.
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • schemaVersion

      public String schemaVersion()
      Returns the value of the schemaVersion record component.
      Returns:
      the value of the schemaVersion record component
    • targetSourcePath

      public String targetSourcePath()
      Returns the value of the targetSourcePath record component.
      Returns:
      the value of the targetSourcePath record component
    • insertionAnchor

      public String insertionAnchor()
      Returns the value of the insertionAnchor record component.
      Returns:
      the value of the insertionAnchor record component
    • targetExists

      public boolean targetExists()
      Returns the value of the targetExists record component.
      Returns:
      the value of the targetExists record component
    • insertedLineCount

      public int insertedLineCount()
      Returns the value of the insertedLineCount record component.
      Returns:
      the value of the insertedLineCount record component
    • unifiedDiff

      public String unifiedDiff()
      Returns the value of the unifiedDiff record component.
      Returns:
      the value of the unifiedDiff record component
    • warnings

      public List<String> warnings()
      Returns the value of the warnings record component.
      Returns:
      the value of the warnings record component