Class FullTextResourceUpdate
java.lang.Object
uno.anahata.asi.toolkit.resources.text.AbstractTextResourceWrite
uno.anahata.asi.toolkit.resources.text.FullTextResourceUpdate
A rich DTO for updating a text file with its full new content. It encapsulates the new content,
optimistic locking metadata from the base class, and a set of line-level comments to provide
explanations for specific changes.
- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<LineComment> A list of comments associated with specific lines in the new content.private StringThe full new content for the file.Fields inherited from class AbstractTextResourceWrite
lastModified, manualOverride, originalContent, originalResourceName, resourceUuid, resultingContent -
Constructor Summary
ConstructorsConstructorDescriptionFullTextResourceUpdate(String resourceUuid, long lastModified, String newContent, List<LineComment> lineComments) Constructs a new FullTextResourceUpdate with explicit properties, utilizing the builder pattern. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringPerforms the actual, tool-specific calculation of the resulting content.voidPerforms pre-flight validation of the update operation.Methods inherited from class AbstractTextResourceWrite
calculateResultingContent, captureOriginalContent, getUnifiedDiff, validateIdenticalContent, validateStructuralState
-
Field Details
-
newContent
The full new content for the file. -
lineComments
A list of comments associated with specific lines in the new content.
-
-
Constructor Details
-
FullTextResourceUpdate
public FullTextResourceUpdate(String resourceUuid, long lastModified, String newContent, List<LineComment> lineComments) Constructs a new FullTextResourceUpdate with explicit properties, utilizing the builder pattern.- Parameters:
resourceUuid- The unique identifier of the target text resource.lastModified- Optimistic locking: the expected last modified timestamp of the file.newContent- The full new content to overwrite the file.lineComments- A list of comments associated with specific lines for rendering.
-
-
Method Details
-
doCalculateResultingContent
Performs the actual, tool-specific calculation of the resulting content.- Specified by:
doCalculateResultingContentin classAbstractTextResourceWrite- Parameters:
agi- The parent agi session.- Returns:
- The calculated resulting content as a String.
- Throws:
Exception- if the calculation logic fails.
-
validate
Performs pre-flight validation of the update operation. Note: This method ensures state is captured.- Overrides:
validatein classAbstractTextResourceWrite- Parameters:
agi- The parent agi session.- Throws:
Exception- if validation fails.
-

